GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
TGo4HDF5Adapter.h
Go to the documentation of this file.
1 // $Id$
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 TGO4HDF5ADAPTER_H
15 #define TGO4HDF5ADAPTER_H
16 
17 
18 #include "Go4HDF5.h"
19 
20 #include "RtypesCore.h"
21 #include "TString.h"
22 
23 #ifndef __CINT__
24 #include "H5Cpp.h"
25 #endif
26 
27 #include "TGo4HDF5DataHandle.h"
28 
29 
36  public:
37 
39  fxFile(nullptr), fxHandle(nullptr), fiFillCount(0), fbDataSetExists(kFALSE), fxEvent(nullptr),
40  fiFlags(H5F_ACC_TRUNC) {
41  }
42 
43  virtual ~TGo4HDF5Adapter() {}
44 
45 
47  static const char *fgcFILESUF;
48 
51  static void AddSubHandle(TGo4HDF5DataHandle *handle, const char *name, const char *type, size_t size,
52  size_t memberoffset, const char *membername, const char *classname, TClass *valueclass);
53 
55  static void FillTypeInfo(TGo4HDF5DataHandle *handle, TClass *rootclass, const char *basename = nullptr);
56 
58  static void FillTypeInfo(TGo4HDF5DataHandle* handle,
59  const char *membername, const char *memtypename, size_t memberoffset = 0,
60  Int_t arraydim = 0, TDataMember *member = nullptr);
61 
62 
63 protected:
64 
66  virtual void OpenFile(const char *fname = nullptr) = 0;
67 
69  virtual void CloseFile();
70 
72  virtual void BuildDataSet(TGo4EventElement *event) = 0;
73 
75  virtual void DeleteDataSet();
76 
80  void BuildDataType(TGo4EventElement *event, TGo4HDF5DataHandle* parent = nullptr, Int_t index = 0);
81 
83  size_t ScanEventSize(TGo4EventElement *event);
84 
86  UInt_t ConvertFileMode(Go4_H5_File_Flags flags);
87 
88 #ifndef __CINT__
89 
91  H5::H5File *fxFile{nullptr};
92 
95 
97  hsize_t fiFillCount{0};
98 
99 #endif
100 
102  Bool_t fbDataSetExists{kFALSE};
103 
106 
108  UInt_t fiFlags{0};
109 
110 };
111 
112 #endif //TGO4HDF5ADAPTER_H
static void FillTypeInfo(TGo4HDF5DataHandle *handle, TClass *rootclass, const char *basename=nullptr)
static const char * fgcFILESUF
virtual void OpenFile(const char *fname=nullptr)=0
H5::H5File * fxFile
UInt_t ConvertFileMode(Go4_H5_File_Flags flags)
virtual void BuildDataSet(TGo4EventElement *event)=0
virtual ~TGo4HDF5Adapter()
TGo4EventElement * fxEvent
size_t ScanEventSize(TGo4EventElement *event)
static void AddSubHandle(TGo4HDF5DataHandle *handle, const char *name, const char *type, size_t size, size_t memberoffset, const char *membername, const char *classname, TClass *valueclass)
virtual void DeleteDataSet()
Go4_H5_File_Flags
Definition: Go4HDF5.h:41
void BuildDataType(TGo4EventElement *event, TGo4HDF5DataHandle *parent=nullptr, Int_t index=0)
virtual void CloseFile()
TGo4HDF5DataHandle * fxHandle