GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
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#include "H5Cpp.h"
24
25#include "TGo4HDF5DataHandle.h"
26
27
34 public:
35
37 fxFile(nullptr), fxHandle(nullptr), fiFillCount(0), fbDataSetExists(kFALSE), fxEvent(nullptr),
38 fiFlags(H5F_ACC_TRUNC) {
39 }
40
41 virtual ~TGo4HDF5Adapter() {}
42
43
45 static const char *fgcFILESUF;
46
49 static void AddSubHandle(TGo4HDF5DataHandle *handle, const char *name, const char *type, size_t size,
50 size_t memberoffset, const char *membername, const char *classname, TClass *valueclass);
51
53 static void FillTypeInfo(TGo4HDF5DataHandle *handle, TClass *rootclass, const char *basename = nullptr);
54
56 static void FillTypeInfo(TGo4HDF5DataHandle *handle, const char *membername, const char *memtypename,
57 size_t memberoffset = 0, Int_t arraydim = 0, TDataMember *member = nullptr);
58
59 protected:
60
62 virtual void OpenFile(const char *fname = nullptr) = 0;
63
65 virtual void CloseFile();
66
68 virtual void BuildDataSet(TGo4EventElement *event) = 0;
69
71 virtual void DeleteDataSet();
72
76 void BuildDataType(TGo4EventElement *event, TGo4HDF5DataHandle* parent = nullptr, Int_t index = 0);
77
79 size_t ScanEventSize(TGo4EventElement *event);
80
83
85 H5::H5File *fxFile{nullptr};
86
89
91 hsize_t fiFillCount{0};
92
95 Bool_t fbDataSetExists{kFALSE};
96
99
101 UInt_t fiFlags{0};
102
103};
104
105#endif //TGO4HDF5ADAPTER_H
Go4_H5_File_Flags
to decouple parameter from hdf5 library we use own definitions for file modes
Definition Go4HDF5.h:41
The abstract base class for the data elements of which the unpacked events (or detector structure dat...
virtual ~TGo4HDF5Adapter()
UInt_t fiFlags
remember file property flags.
void BuildDataType(TGo4EventElement *event, TGo4HDF5DataHandle *parent=nullptr, Int_t index=0)
Prepare data type from event structure for hdf5.
UInt_t ConvertFileMode(Go4_H5_File_Flags flags)
Convert common go4 filemode flags to hdf5 flags:
Bool_t fbDataSetExists
True if branch already exists.
TGo4HDF5DataHandle * fxHandle
handle object to recursively treat the io of nested event components
hsize_t fiFillCount
counter of filled events.
virtual void DeleteDataSet()
delete dataset resource
size_t ScanEventSize(TGo4EventElement *event)
evaluate total memory size of event object regarding composite subevents
virtual void OpenFile(const char *fname=nullptr)=0
opens the hdf5 file depending on the setup
virtual void BuildDataSet(TGo4EventElement *event)=0
initialize dataset from event structure
static void FillTypeInfo(TGo4HDF5DataHandle *handle, TClass *rootclass, const char *basename=nullptr)
evaluate h5 type information from root class streamer
virtual void CloseFile()
opens the hdf5 file depending on the setup
TGo4EventElement * fxEvent
Points to event structure to be filled into dataset.
static const char * fgcFILESUF
Standard suffix for file name.
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)
Add subhandle to handle that represents a contained collection.
H5::H5File * fxFile
the currently open hdf5 file
The base class to access a datatype with substructures in hdf5.