Particle Identification and Tracking
wrapper_i_file.h
Go to the documentation of this file.
1 //Copyright 2008,2009 Thomas A Caswell
2 //tcaswell@uchicago.edu
3 //http://jfi.uchicago.edu/~tcaswell
4 //
5 //This program is free software; you can redistribute it and/or modify
6 //it under the terms of the GNU General Public License as published by
7 //the Free Software Foundation; either version 3 of the License, or (at
8 //your option) any later version.
9 //
10 //This program is distributed in the hope that it will be useful, but
11 //WITHOUT ANY WARRANTY; without even the implied warranty of
12 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 //General Public License for more details.
14 //
15 //You should have received a copy of the GNU General Public License
16 //along with this program; if not, see <http://www.gnu.org/licenses>.
17 //
18 //Additional permission under GNU GPL version 3 section 7
19 //
20 //If you modify this Program, or any covered work, by linking or
21 //combining it with MATLAB (or a modified version of that library),
22 //containing parts covered by the terms of MATLAB User License, the
23 //licensors of this Program grant you additional permission to convey
24 //the resulting work.
25 #include <iostream>
26 #include <map>
27 
28 #include "wrapper_i.h"
29 
30 #ifndef WRAPPER_FILE
31 #define WRAPPER_FILE
32 namespace utilities{
33 
34 using std::map;
42 private:
44  double * first;
45  double get_value(int ind, utilities::D_TYPE type)const;
46 
47 protected:
49  int rows;
50 
51  int cols;
52  map<utilities::D_TYPE, int> contents;
53  void fill_data(std:string file_name, int row, int col);
54  vector<int> frame_edges_;
55 
56 public:
57 
58 
59  int get_value(int& out,
60  int ind,D_TYPE type, int frame) const ;
61  float get_value(float& out,
62  int ind,D_TYPE type, int frame) const ;
63  std::complex<float> get_value(std::complex<float>& out,
64  int ind,D_TYPE type, int frame) const ;
65 
66 
67  std::set<D_TYPE> get_data_types() const ;
68 
69 
70 
71  int get_num_entries(int frame) const ;
72 
73  int get_num_frames() const ;
74 
75  bool contains_type(D_TYPE type) const ;
76 
77  Tuple get_dims() const;
78 
80  Wrapper_i_file(const std::string & fname,
81  const std::set<utilities::D_TYPE>& dtypes,
82  int rows,
83  const std::vector<int>& frame_edges);
84 
85 
86 
87 
88 };
89 }
90 
91 #endif