GSI Object Oriented Online Offline (Go4)  GO4-6.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4HDF5DataHandle.h
Go to the documentation of this file.
1 // $Id: TGo4HDF5DataHandle.h 2688 2020-01-10 13:35:00Z linev $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #ifndef TGO4HDF5DATAHANDLE_H
15 #define TGO4HDF5DATAHANDLE_H
16 
17 
18 #include "Go4HDF5.h"
19 #include "Rtypes.h"
20 #include "TString.h"
21 #include "TObject.h"
22 
23 #ifndef __CINT__
24 #include "H5Cpp.h"
25 #endif
26 
27 class TClass;
28 class TDataMember;
29 class TGo4EventElement;
30 class TGo4HDF5Source;
31 
32 class TGo4HDF5DataHandle;
33 
35 {
36 public:
37 
39 
41  TGo4HDF5DataHandle* CreateDataHandle(const char* name, size_t datasize, const char* type);
42 };
43 
44 
45 
54 
55 
56 
57 
58 public:
59 
61  TGo4HDF5DataHandle(const char* name, size_t datasize);
62  virtual ~TGo4HDF5DataHandle();
63 
65  H5::CompType* GetType(){return fxType;}
66 
67  const char* GetTypeName(){return fxTypeName.Data();}
68 
69  void* Data() {return fxData;}
70 
72  void InsertTypeMember(const H5std_string& name, size_t offset, const H5::DataType& new_member);
73 
75  void SetParentOffset(size_t off) {
76  fiParentOffset=off;
77  }
78 
79 
80 
81 
83  virtual void SetObjectPointer(void* memptr);
84 
87  void SetTopEvent(TGo4EventElement* eve);
88 
89 
92  void SetTopEventClass(const char* classname);
93 
95  void SetMemberName(const char* name) {fxMemberHandle=name;}
96 
98  void SetMemberClass(const char* clname) {fxMemberClass=clname;}
99 
100 
103  virtual void BuildReadDataset(H5::H5File*file, TGo4HDF5Source* parent);
104 
106  virtual void BuildWriteDataset(H5::H5File* file);
107 
108 
110  virtual void Read(hsize_t sequencenum, H5::H5File* file);
111 
113  virtual void Write(hsize_t sequencenum, H5::H5File* file);
114 
118  TGo4HDF5DataHandle* AddSubMember(const char* name, size_t datasize, const char* collectiontype=0);
119 
120 
121 
122  TGo4HDF5DataHandle* GetSubMember(UInt_t ix){ return (ix< fxSubcomponents.size() ? fxSubcomponents[ix] : 0);}
123 
125  TGo4HDF5DataHandle* FindSubMember(const char* name);
126 
127  void SetActive(Bool_t on){fbDataSetActive=on;}
128 
129  void SetAllSubMembersActive(Bool_t on);
130 
131 
133 
134 
135 protected:
136 
137 
138 
139 
140 
141 
143  TString fxTypeName;
144 
145 #ifndef __CINT__
146 
148  H5::CompType* fxType;
149 
150 
152  H5::DataSet fxDataSet;
153 
155  H5::DataSpace* fxDataSpace;
156 
158  H5::DataSpace fxFileSpace;
159 
161  ULong_t fiEntries;
162 
163 #endif
164 
166  void* fxData;
167 
169  size_t fiParentOffset;
170 
171 
173  size_t fiDataSize;
174 
175 
177  size_t fiReadOffset;
178 
179 
180 
181 
182 
183 
184 
186  std::vector<TGo4HDF5DataHandle*> fxSubcomponents;
187 
188 
190  TString fxMemberHandle;
191 
193  TString fxMemberClass;
194 
197 
199  TString fxEventClass;
200 
203 
206 
210 
211 };
212 
213 
214 
215 
217 
218 
225 
226 {
227 
228 
229 
230 
231 public:
232 
234  TGo4HDF5BasicDataHandle(const char* name, size_t datasize);
235  virtual ~TGo4HDF5BasicDataHandle();
236 
237 
238 
241  virtual void BuildReadDataset(H5::H5File*file, TGo4HDF5Source* parent);
242 
244  virtual void BuildWriteDataset(H5::H5File* file);
245 
246 
248  virtual void Read(hsize_t sequencenum, H5::H5File*file);
249 
251  virtual void Write(hsize_t sequencenum, H5::H5File*file);
252 
253 
254 protected:
255 
257  void AllocReadBuffer(size_t size);
258 
259 
261  Char_t* fxReadBuffer;
262 
263 
264 
265 
266 
267 
268 
269 };
270 
271 
272 
273 
274 
275 
276 
277 
278 
279 
280 
282 
283 
284 
285 
292 
293 {
294 
295 public:
296 
298  TGo4HDF5CompositeDataHandle(const char* name, size_t datasize);
300 
301 
302 
305  virtual void BuildReadDataset(H5::H5File*file, TGo4HDF5Source* parent);
306 
308  virtual void BuildWriteDataset(H5::H5File* file);
309 
310 
312  virtual void Read(hsize_t sequencenum, H5::H5File* file);
313 
315  virtual void Write(hsize_t sequencenum, H5::H5File* file);
316 
317 
318 
319 
320 };
321 
322 
323 
324 
326 
329 {
330  hvl_t fxArray;
331 };
332 
333 
334 
335 
336 
344 
345 {
346 
347 
348 public:
349 
351  TGo4HDF5VectorDataHandle(const char* name, size_t datasize);
352  virtual ~TGo4HDF5VectorDataHandle();
353 
354 
356  void SetElementSize(size_t len) {fiElementSize=len;}
357 
359  virtual void SetObjectPointer(void* memptr);
360 
363  virtual void BuildReadDataset(H5::H5File*file, TGo4HDF5Source* parent);
364 
366  virtual void BuildWriteDataset(H5::H5File* file);
367 
368 
370  virtual void Read(hsize_t sequencenum, H5::H5File* file);
371 
373  virtual void Write(hsize_t sequencenum, H5::H5File* ile);
374 
375 
376 protected:
377 
378 
379 #ifndef __CINT__
380 
383  H5::CompType* fxCollection;
384 
385 
388 
389 #endif
390 
391 
393  size_t fiElementSize;//
394 
395 };
396 
397 
399 {
400 public:
401 
402  unsigned long fx_Begin_ptr;
403  unsigned long fx_End_ptr;
404  unsigned long fx_Cap_ptr;
405 };
406 
407 
408 
409 
418 
419 {
420 
421 
422 public:
423 
425  TGo4HDF5SubVectorDataHandle(const char* name, size_t datasize);
427 
428 
429 
431  virtual void SetObjectPointer(void* memptr);
432 
435  void BuildReadDataset(H5::H5File*file, TGo4HDF5Source* parent);
436 
438  void BuildWriteDataset(H5::H5File* file);
439 
440 
442  void Read(hsize_t sequencenum, H5::H5File* file);
443 
445  void Write(hsize_t sequencenum, H5::H5File* file);
446 
447  void SetInnerClassName(const char* nm) {fxInnerClassName=nm;}
448 
449 
450 protected:
451 
452 
455 
456 
457 };
458 
459 
460 
461 
462 #endif //TGO4HDF5DATAHANDLE_H
void SetInnerClassName(const char *nm)
void SetActive(Bool_t on)
virtual void BuildReadDataset(H5::H5File *file, TGo4HDF5Source *parent)
H5::DataSpace * fxDataSpace
virtual void BuildReadDataset(H5::H5File *file, TGo4HDF5Source *parent)
void InsertTypeMember(const H5std_string &name, size_t offset, const H5::DataType &new_member)
void AllocReadBuffer(size_t size)
TGo4HDF5DataHandle * CreateDataHandle(const char *name, size_t datasize, const char *type)
TGo4EventElement * fxEvent
void Read(hsize_t sequencenum, H5::H5File *file)
virtual void Write(hsize_t sequencenum, H5::H5File *ile)
virtual void BuildWriteDataset(H5::H5File *file)
virtual void SetObjectPointer(void *memptr)
virtual void Read(hsize_t sequencenum, H5::H5File *file)
virtual void BuildReadDataset(H5::H5File *file, TGo4HDF5Source *parent)
void SetAllSubMembersActive(Bool_t on)
virtual void BuildWriteDataset(H5::H5File *file)
H5::DataSpace fxFileSpace
virtual void Write(hsize_t sequencenum, H5::H5File *file)
virtual void Read(hsize_t sequencenum, H5::H5File *file)
std::vector< TGo4HDF5DataHandle * > fxSubcomponents
virtual void Read(hsize_t sequencenum, H5::H5File *file)
H5::CompType * GetType()
virtual void Write(hsize_t sequencenum, H5::H5File *file)
virtual void Write(hsize_t sequencenum, H5::H5File *file)
virtual void BuildWriteDataset(H5::H5File *file)
void BuildWriteDataset(H5::H5File *file)
void SetTopEventClass(const char *classname)
const char * GetTypeName()
void SetTopEvent(TGo4EventElement *eve)
TGo4HDF5CompositeDataHandle(const char *name, size_t datasize)
TGo4HDF5BasicDataHandle(const char *name, size_t datasize)
virtual void BuildReadDataset(H5::H5File *file, TGo4HDF5Source *parent)
TGo4HDF5Source * fxParentSource
virtual void BuildWriteDataset(H5::H5File *file)
TGo4HDF5SubVectorDataHandle(const char *name, size_t datasize)
void Write(hsize_t sequencenum, H5::H5File *file)
TGo4HDF5DataHandle(const char *name, size_t datasize)
TGo4HDF5DataHandle * FindSubMember(const char *name)
virtual void SetObjectPointer(void *memptr)
unsigned long fx_Begin_ptr
void SetParentOffset(size_t off)
virtual void Read(hsize_t sequencenum, H5::H5File *file)
virtual void SetObjectPointer(void *memptr)
static TGo4HDF5DataHandleFactory fxFactory
TGo4HDF5VectorDataHandle(const char *name, size_t datasize)
TGo4HDF5VarContainer fxVarHandle
TGo4HDF5DataHandle * GetSubMember(UInt_t ix)
TGo4HDF5DataHandle * AddSubMember(const char *name, size_t datasize, const char *collectiontype=0)
void BuildReadDataset(H5::H5File *file, TGo4HDF5Source *parent)
void SetMemberName(const char *name)
void SetElementSize(size_t len)
void SetMemberClass(const char *clname)