Particle Identification and Tracking
generic_wrapper.h
Go to the documentation of this file.
1 //Copyright 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 
26 #ifndef GWRAPPER_BASE2
27 #define GWRAPPER_BASE2
28 #include <vector>
29 #include "enum_utils.h"
30 #include "tuple.h"
31 
32 namespace utilities{
33 
34 class Md_store;
35 
36 
47 public:
57  virtual void open_wrapper() =0;
58 
62  virtual void close_wrapper() = 0;
63 
67  virtual bool is_open() const = 0;
69 
79  virtual void open_group(const std::string & name = "none")=0;
83  virtual void close_group()=0;
84 
86 
93 
105  virtual void add_dset(int rank,const unsigned int * dims, V_TYPE vt , const void * data,const std::string & dset_name)=0;
106 
107 
109 
120  virtual void add_meta_data(const std::string & key, float val)=0;
124  virtual void add_meta_data(const std::string & key, const Tuple<float,3> & val)=0;
128  virtual void add_meta_data(const std::string & key, const Tuple<float,2>& val)=0;
132  virtual void add_meta_data(const std::string & key, const std::string & val)=0;
136  virtual void add_meta_data(const std::string & key, int val)=0;
140  virtual void add_meta_data(const std::string & key, unsigned int val)=0;
144  virtual void add_meta_data(const Md_store * md_store)=0;
146 
156  virtual void add_meta_data(const std::string & key, float val,const std::string & dset_name)=0;
160  virtual void add_meta_data(const std::string & key, const Tuple<float,3> & val,const std::string & dset_name)=0;
164  virtual void add_meta_data(const std::string & key, const Tuple<float,2>& val,const std::string & dset_name)=0;
168  virtual void add_meta_data(const std::string & key, const std::string & val,const std::string & dset_name)=0;
172  virtual void add_meta_data(const std::string & key, int val,const std::string & dset_name)=0;
176  virtual void add_meta_data(const std::string & key, unsigned int val,const std::string & dset_name)=0;
180  virtual void add_meta_data(const Md_store * md_store,const std::string & dset_name)=0;
182 
185  virtual ~Generic_wrapper(){};
186 
187 
188 
189 };
197 {
198 public:
208  virtual void open_wrapper() =0;
209 
213  virtual void close_wrapper() = 0;
214 
218  virtual bool is_open() const = 0;
220 
230  virtual void open_group(const std::string & name = "none")=0;
234  virtual void close_group()=0;
235 
237 
245 
249  virtual void get_dset(std::vector<int> & data,std::vector<unsigned int> & dims, const std::string & dset_name) const=0;
250  virtual void get_dset(std::vector<unsigned int> & data, std::vector<unsigned int> & dims,const std::string & dset_name) const=0;
251  virtual void get_dset(std::vector<float> & data, std::vector<unsigned int> & dims, const std::string & dset_name) const=0;
252 
259  virtual void get_dset_info(std::vector<int> & dims,V_TYPE& vt ,const std::string & dset_name) const=0;
260 
261 
263 
271 
275  virtual float get_meta_data(const std::string & key, float & val)=0;
279  virtual Tuple<float,3> get_meta_data(const std::string & key, Tuple<float,3> & val)=0;
283  virtual Tuple<float,2> get_meta_data(const std::string & key, Tuple<float,2>& val)=0;
287  virtual std::string get_meta_data(const std::string & key, std::string & val)=0;
291  virtual int get_meta_data(const std::string & key, int & val)=0;
295  virtual unsigned int get_meta_data(const std::string & key, unsigned int& val)=0;
296 
300  virtual Md_store& get_meta_data(Md_store & md_store)=0;
302 
309 
313  virtual float get_meta_data(const std::string & key, float& val,const std::string & dset_name)=0;
317  virtual Tuple<float,3> get_meta_data(const std::string & key, Tuple<float,3> & val,const std::string & dset_name)=0;
321  virtual Tuple<float,2> get_meta_data(const std::string & key, Tuple<float,2>& val,const std::string & dset_name)=0;
325  virtual std::string get_meta_data(const std::string & key, std::string & val,const std::string & dset_name)=0;
329  virtual int get_meta_data(const std::string & key, int &val,const std::string & dset_name)=0;
333  virtual Md_store& get_meta_data(Md_store & md_store,const std::string & dset_name)=0;
335 
339 
340 
341 } ;
342 
343 
344 }
345 #endif