00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _HDF5SERIE_SIMPLEDATASET_H_
00023 #define _HDF5SERIE_SIMPLEDATASET_H_
00024
00025 #include <H5Cpp.h>
00026 #include <vector>
00027 #include <string>
00028 #include <hdf5serie/toh5type.h>
00029 #include <hdf5serie/simpleattribute.h>
00030 #include <assert.h>
00031
00032 namespace H5 {
00033
00059 template<class T>
00060 class SimpleDataSet : public DataSet {
00061 private:
00062 DataSpace dataSpace;
00063 DataType memDataType;
00064 public:
00066 SimpleDataSet();
00067
00069 SimpleDataSet(const SimpleDataSet<T>& dataset);
00070
00075 SimpleDataSet(const CommonFG& parent, const std::string& name, bool create=false);
00076
00081 SimpleDataSet(const CommonFG& parent, const std::string& name, const T& data);
00082
00087 void create(const CommonFG& parent, const std::string& name);
00088
00093 void open(const CommonFG& parent, const std::string& name);
00094
00099 void write(const T& data);
00100
00105 T read();
00106
00111 void write(const CommonFG& parent, const std::string& name, const T& data);
00112
00117 T read(const CommonFG& parent, const std::string& name);
00118
00123 void setDescription(const std::string& description);
00124
00129 std::string getDescription();
00130
00135 static T getData(const CommonFG& parent, const std::string& name);
00136 };
00137
00138
00139 template<class T>
00140 class SimpleDataSet<std::vector<T> > : public DataSet {
00141 private:
00142 DataType memDataType;
00143 public:
00144 SimpleDataSet();
00145 SimpleDataSet(const SimpleDataSet<std::vector<T> >& dataset);
00146 SimpleDataSet(const CommonFG& parent, const std::string& name, bool create=false);
00147 SimpleDataSet(const CommonFG& parent, const std::string& name, const std::vector<T>& data);
00148 void create(const CommonFG& parent, const std::string& name);
00149 void open(const CommonFG& parent, const std::string& name);
00150 void write(const std::vector<T>& data);
00151 std::vector<T> read();
00152 void write(const CommonFG& parent, const std::string& name, const std::vector<T>& data);
00153 std::vector<T> read(const CommonFG& parent, const std::string& name);
00154 void setDescription(const std::string& description);
00155 std::string getDescription();
00156 static std::vector<T> getData(const CommonFG& parent, const std::string& name);
00157 };
00158
00159
00160 template<class T>
00161 class SimpleDataSet<std::vector<std::vector<T> > > : public DataSet {
00162 private:
00163 DataType memDataType;
00164 public:
00165 SimpleDataSet();
00166 SimpleDataSet(const SimpleDataSet<std::vector<std::vector<T> > >& dataset);
00167 SimpleDataSet(const CommonFG& parent, const std::string& name, bool create=false);
00168 SimpleDataSet(const CommonFG& parent, const std::string& name, const std::vector<std::vector<T> >& data);
00169 void create(const CommonFG& parent, const std::string& name);
00170 void open(const CommonFG& parent, const std::string& name);
00171 void write(const std::vector<std::vector<T> >& data);
00172 std::vector<std::vector<T> > read();
00173 void write(const CommonFG& parent, const std::string& name, const std::vector<std::vector<T> >& data);
00174 std::vector<std::vector<T> > read(const CommonFG& parent, const std::string& name);
00175 void setDescription(const std::string& description);
00176 std::string getDescription();
00177 static std::vector<std::vector<T> > getData(const CommonFG& parent, const std::string& name);
00178 };
00179
00180 }
00181
00182 #endif