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
00027
00028 #ifndef CASA_HDF5DATASET_H
00029 #define CASA_HDF5DATASET_H
00030
00031
00032 #include <casacore/casa/aips.h>
00033 #include <casacore/casa/HDF5/HDF5Object.h>
00034 #include <casacore/casa/HDF5/HDF5HidMeta.h>
00035 #include <casacore/casa/HDF5/HDF5DataType.h>
00036 #include <casacore/casa/Arrays/Slicer.h>
00037 #include <casacore/casa/BasicSL/String.h>
00038 #include <casacore/casa/Utilities/DataType.h>
00039
00040 namespace casacore {
00041
00042
00043 template<typename T> class Block;
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085 class HDF5DataSet : public HDF5Object
00086 {
00087 public:
00088
00089
00090
00091 HDF5DataSet (const HDF5Object&, const String&, const IPosition& shape,
00092 const IPosition& tileShape, const Bool*);
00093 HDF5DataSet (const HDF5Object&, const String&, const IPosition& shape,
00094 const IPosition& tileShape, const uChar*);
00095 HDF5DataSet (const HDF5Object&, const String&, const IPosition& shape,
00096 const IPosition& tileShape, const Int*);
00097 HDF5DataSet (const HDF5Object&, const String&, const IPosition& shape,
00098 const IPosition& tileShape, const Int64*);
00099 HDF5DataSet (const HDF5Object&, const String&, const IPosition& shape,
00100 const IPosition& tileShape, const Float*);
00101 HDF5DataSet (const HDF5Object&, const String&, const IPosition& shape,
00102 const IPosition& tileShape, const Double*);
00103 HDF5DataSet (const HDF5Object&, const String&, const IPosition& shape,
00104 const IPosition& tileShape, const Complex*);
00105 HDF5DataSet (const HDF5Object&, const String&, const IPosition& shape,
00106 const IPosition& tileShape, const DComplex*);
00107
00108
00109
00110
00111
00112 HDF5DataSet (const HDF5Object&, const String&, const Bool*);
00113 HDF5DataSet (const HDF5Object&, const String&, const uChar*);
00114 HDF5DataSet (const HDF5Object&, const String&, const Int*);
00115 HDF5DataSet (const HDF5Object&, const String&, const Int64*);
00116 HDF5DataSet (const HDF5Object&, const String&, const Float*);
00117 HDF5DataSet (const HDF5Object&, const String&, const Double*);
00118 HDF5DataSet (const HDF5Object&, const String&, const Complex*);
00119 HDF5DataSet (const HDF5Object&, const String&, const DComplex*);
00120
00121
00122
00123 ~HDF5DataSet();
00124
00125
00126 virtual void close();
00127
00128
00129
00130 void setCacheSize (uInt nchunks);
00131
00132
00133 static DataType getDataType (hid_t, const String& name);
00134
00135
00136 const IPosition& shape() const
00137 { return itsShape; }
00138
00139
00140 const IPosition& tileShape() const
00141 { return itsTileShape; }
00142
00143
00144
00145 void get (const Slicer&, void* buf);
00146
00147
00148 void put (const Slicer&, const void* buf);
00149
00150
00151 void extend (const IPosition& shape);
00152
00153
00154
00155
00156 static Block<hsize_t> fromShape (const IPosition& shape);
00157 static IPosition toShape (const Block<hsize_t>& b);
00158
00159
00160 private:
00161
00162 HDF5DataSet (const HDF5DataSet& that);
00163
00164 HDF5DataSet& operator= (const HDF5DataSet& that);
00165
00166
00167 void create (const HDF5Object&, const String&,
00168 const IPosition& shape, const IPosition& tileShape);
00169
00170
00171 void open (const HDF5Object&, const String&);
00172
00173
00174 void closeDataSet();
00175
00176 HDF5HidDataSpace itsDSid;
00177 HDF5HidProperty itsPLid;
00178 HDF5HidProperty itsDaplid;
00179 IPosition itsShape;
00180 IPosition itsTileShape;
00181 HDF5DataType itsDataType;
00182 const HDF5Object* itsParent;
00183 };
00184
00185 }
00186
00187 #endif