00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef WRAPPER_I_HDF
00027 #define WRAPPER_I_HDF
00028
00029 #include "H5Cpp.h"
00030
00031 #include <string>
00032 #include <vector>
00033 #include <map>
00034 #include "wrapper_i.h"
00035
00036 namespace tracking
00037 {
00038 template <class T>
00039 class master_box_t;
00040 class particle;
00041
00042 }
00043
00044
00045 namespace utilities{
00046
00047 class Params_hdf5;
00048
00052 class Wrapper_i_hdf5:public Wrapper_in{
00053 private:
00057 std::string file_name_;
00058
00059 H5::H5File * file_;
00060 mutable H5::Group * current_group_;
00061 mutable int current_frame_;
00062 bool file_open_;
00063
00064 static std::string format_name(int in);
00065
00066 void check_group(int frame) const;
00067
00068 std::set<utilities::D_TYPE> data_types_;
00069
00070 protected:
00071
00072 void init();
00073 public:
00074
00075 int get_value(int& out,
00076 int ind,D_TYPE type, int frame) const ;
00077 float get_value(float& out,
00078 int ind,D_TYPE type, int frame) const ;
00079 std::complex<float> get_value(std::complex<float>& out,
00080 int ind,D_TYPE type, int frame) const ;
00081 std::set<D_TYPE>get_data_types() const ;
00082
00083
00084
00085 int get_num_entries(int frame) const ;
00086
00087 int get_num_frames() const ;
00088
00089 bool contains_type(D_TYPE type) const ;
00090
00091
00092
00093
00094 ~Wrapper_i_hdf5();
00095
00096 Wrapper_i_hdf5(std::string fname,std::set<utilities::D_TYPE> dtypes);
00097
00098 void open_file();
00099
00100 void close_file();
00101
00102
00103
00104
00105 };
00106
00107 }
00108
00109 #endif