00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _HDF5SERIE_VECTORSERIE_H_
00023 #define _HDF5SERIE_VECTORSERIE_H_
00024
00025 #include <H5Cpp.h>
00026 #include <vector>
00027 #include <string>
00028 #include <assert.h>
00029 #include <hdf5serie/simpleattribute.h>
00030 #include <hdf5serie/fileserie.h>
00031
00032 namespace H5 {
00033
00034
00035
00066 template<class T>
00067 class VectorSerie : public DataSet {
00068 private:
00069 DataType memDataType;
00070 DataSpace memDataSpace;
00071 hsize_t dims[2];
00072 public:
00077 VectorSerie();
00078
00080 VectorSerie(const VectorSerie<T>& dataset);
00081
00086 VectorSerie(const CommonFG& parent, const std::string& name);
00087
00092 VectorSerie(const CommonFG& parent, const std::string& name, const std::vector<std::string>& columnLabel, int compression=FileSerie::getDefaultCompression(), int chunkSize=FileSerie::getDefaultChunkSize());
00093
00103 void create(const CommonFG& parent, const std::string& name, const std::vector<std::string>& columnLabel, int compression=FileSerie::getDefaultCompression(), int chunkSize=FileSerie::getDefaultChunkSize());
00104
00109 void open(const CommonFG& parent, const std::string& name);
00110
00115 void setDescription(const std::string& desc);
00116
00122 void append(const std::vector<T> &data);
00123
00125 inline int getRows();
00126
00128 inline unsigned int getColumns();
00129
00134 std::vector<T> getRow(const int row);
00135
00140 std::vector<T> getColumn(const int column);
00141
00146 std::string getDescription();
00147
00153 std::vector<std::string> getColumnLabel();
00154
00155 void extend(const hsize_t* size);
00156 };
00157
00158
00159
00160
00161
00162 template<class T>
00163 int VectorSerie<T>::getRows() {
00164
00165 DataSpace fileDataSpace=getSpace();
00166 fileDataSpace.getSimpleExtentDims(dims);
00167
00168 return dims[0];
00169 }
00170
00171 template<class T>
00172 unsigned int VectorSerie<T>::getColumns() {
00173 return dims[1];
00174 }
00175
00176 }
00177
00178 #endif // _TIMESERIE_H_