GSI Object Oriented Online Offline (Go4) GO4-6.4.0
|
The base class to access a datatype with substructures in hdf5. More...
#include <TGo4HDF5DataHandle.h>
Public Member Functions | |
TGo4HDF5DataHandle (const char *name, size_t datasize) | |
create new data handle | |
virtual | ~TGo4HDF5DataHandle () |
TGo4HDF5DataHandle * | AddSubMember (const char *name, size_t datasize, const char *collectiontype=nullptr) |
create new subhandle for complex member component on heap. | |
virtual void | BuildReadDataset (H5::H5File *file, TGo4HDF5Source *parent) |
create datasets and buffers for reading this structure from hdf5 file. | |
virtual void | BuildWriteDataset (H5::H5File *file) |
create datasets for writing memory structure of type into file. | |
void * | Data () const |
TGo4HDF5DataHandle * | FindSubMember (const char *name) |
lookup if subcomponent of name already is in list. | |
TGo4HDF5DataHandle * | GetSubMember (UInt_t ix) |
H5::CompType * | GetType () const |
return handle for type descriptor. | |
const char * | GetTypeName () const |
void | InsertTypeMember (const H5std_string &name, size_t offset, const H5::DataType &new_member) |
wrapper function to define contained structure member. | |
virtual void | Read (hsize_t sequencenum, H5::H5File *file) |
Read event of sequence number from file. | |
void | SetActive (Bool_t on) |
void | SetAllSubMembersActive (Bool_t on) |
void | SetMemberClass (const char *clname) |
type of the member to access from outside | |
void | SetMemberName (const char *name) |
identifier for the member to access from outside using the top event handle | |
virtual void | SetObjectPointer (void *memptr) |
define location of corresponding object in memory. | |
void | SetParentOffset (size_t off) |
remember location of this object relative to upper level object. | |
void | SetTopEvent (TGo4EventElement *eve) |
pass the top level event element down the member hierarchy. | |
void | SetTopEventClass (const char *classname) |
pass the top level event element class down the member hierarchy. | |
virtual void | Write (hsize_t sequencenum, H5::H5File *file) |
Write event of sequence number from file. | |
Static Public Attributes | |
static TGo4HDF5DataHandleFactory | fxFactory |
Protected Attributes | |
Bool_t | fbDataSetActive {kFALSE} |
we may disable this dataset temporarily from writing or reading useful for dynamic vector of vector components | |
Bool_t | fbDataSetExists {kFALSE} |
check on the fly if this handle has already created a dataset | |
size_t | fiDataSize {0} |
size of data structure in bytes, for redefining output dataset | |
ULong_t | fiEntries {0} |
number of event entries found in file dataspace | |
size_t | fiParentOffset {0} |
offset of this data structure relative to top level event object | |
size_t | fiReadOffset {0} |
begin of real eventdata payload after event object pointer | |
void * | fxData {nullptr} |
pointer to begin of data in memory | |
H5::DataSet | fxDataSet |
dataset containing the structure | |
H5::DataSpace * | fxDataSpace {nullptr} |
dataspace in memory | |
TGo4EventElement * | fxEvent {nullptr} |
the top level event element to access the current data member from outside | |
TString | fxEventClass |
the top level event element classname to access the current data member from outside | |
H5::DataSpace | fxFileSpace |
dataspace in file | |
TString | fxMemberClass |
classname of the entry for interpreter to operate e.g. | |
TString | fxMemberHandle |
predefined interpreter access command e.g. | |
TGo4HDF5Source * | fxParentSource {nullptr} |
backpointer to parent source for exceptions | |
std::vector< TGo4HDF5DataHandle * > | fxSubcomponents |
collect sub-components of the referenced data object | |
H5::CompType * | fxType {nullptr} |
component type representing the data structure | |
TString | fxTypeName |
identifier of the dataset | |
The base class to access a datatype with substructures in hdf5.
datahandle may contain other datahandles as direct sub-components Each datahandle represents a single hdf5 dataset in the file
Definition at line 48 of file TGo4HDF5DataHandle.h.
TGo4HDF5DataHandle::TGo4HDF5DataHandle | ( | const char * | name, |
size_t | datasize ) |
create new data handle
Definition at line 30 of file TGo4HDF5DataHandle.cxx.
References fbDataSetActive, fbDataSetExists, fiDataSize, fiEntries, fiParentOffset, fiReadOffset, fxData, fxDataSet, fxDataSpace, fxEvent, fxFileSpace, fxParentSource, fxType, fxTypeName, and go4hdfdbg.
Referenced by TGo4HDF5BasicDataHandle::TGo4HDF5BasicDataHandle(), ~TGo4HDF5DataHandle(), AddSubMember(), BuildReadDataset(), BuildWriteDataset(), FindSubMember(), GetSubMember(), Read(), SetAllSubMembersActive(), SetObjectPointer(), SetTopEvent(), SetTopEventClass(), and Write().
|
virtual |
Definition at line 40 of file TGo4HDF5DataHandle.cxx.
References TGo4HDF5DataHandle(), fxDataSet, fxDataSpace, fxSubcomponents, fxType, fxTypeName, and go4hdfdbg.
TGo4HDF5DataHandle * TGo4HDF5DataHandle::AddSubMember | ( | const char * | name, |
size_t | datasize, | ||
const char * | collectiontype = nullptr ) |
create new subhandle for complex member component on heap.
Each complex component has separate dataset in file. returns the currently added handle to submember. If submember is part of a collection like std::vector, the name of collection is also passed.
Definition at line 63 of file TGo4HDF5DataHandle.cxx.
References TGo4HDF5DataHandle(), fxFactory, and fxSubcomponents.
Referenced by TGo4HDF5Adapter::AddSubHandle(), TGo4HDF5Adapter::BuildDataType(), and TGo4HDF5SubVectorDataHandle::SetObjectPointer().
|
virtual |
create datasets and buffers for reading this structure from hdf5 file.
parent pointer is given for error handling case
Reimplemented in TGo4HDF5BasicDataHandle, TGo4HDF5CompositeDataHandle, TGo4HDF5SubVectorDataHandle, and TGo4HDF5VectorDataHandle.
Definition at line 138 of file TGo4HDF5DataHandle.cxx.
References TGo4HDF5DataHandle(), BuildReadDataset(), and fxSubcomponents.
Referenced by TGo4HDF5BasicDataHandle::BuildReadDataset(), BuildReadDataset(), TGo4HDF5SubVectorDataHandle::BuildReadDataset(), and TGo4HDF5SubVectorDataHandle::Read().
|
virtual |
create datasets for writing memory structure of type into file.
Reimplemented in TGo4HDF5BasicDataHandle, TGo4HDF5CompositeDataHandle, TGo4HDF5SubVectorDataHandle, and TGo4HDF5VectorDataHandle.
Definition at line 148 of file TGo4HDF5DataHandle.cxx.
References TGo4HDF5DataHandle(), BuildWriteDataset(), and fxSubcomponents.
Referenced by TGo4HDF5BasicDataHandle::BuildWriteDataset(), BuildWriteDataset(), and TGo4HDF5VectorDataHandle::BuildWriteDataset().
|
inline |
Definition at line 61 of file TGo4HDF5DataHandle.h.
References fxData.
Referenced by TGo4HDF5Adapter::AddSubHandle(), TGo4HDF5Adapter::BuildDataType(), TGo4HDF5Adapter::FillTypeInfo(), and TGo4HDF5SubVectorDataHandle::SetObjectPointer().
TGo4HDF5DataHandle * TGo4HDF5DataHandle::FindSubMember | ( | const char * | name | ) |
lookup if subcomponent of name already is in list.
returns 0 pointer if no match of name, otherwise th matching subhandle
Definition at line 70 of file TGo4HDF5DataHandle.cxx.
References TGo4HDF5DataHandle(), FindSubMember(), fxSubcomponents, and GetTypeName().
Referenced by FindSubMember(), and TGo4HDF5SubVectorDataHandle::SetObjectPointer().
|
inline |
Definition at line 106 of file TGo4HDF5DataHandle.h.
References TGo4HDF5DataHandle(), and fxSubcomponents.
|
inline |
return handle for type descriptor.
Currently this is filled from external routine of adapter class
Definition at line 57 of file TGo4HDF5DataHandle.h.
References fxType.
Referenced by TGo4HDF5Adapter::FillTypeInfo().
|
inline |
Definition at line 59 of file TGo4HDF5DataHandle.h.
References fxTypeName.
Referenced by TGo4HDF5Adapter::BuildDataType(), FindSubMember(), and TGo4HDF5SubVectorDataHandle::SetObjectPointer().
void TGo4HDF5DataHandle::InsertTypeMember | ( | const H5std_string & | name, |
size_t | offset, | ||
const H5::DataType & | new_member ) |
wrapper function to define contained structure member.
Will also keep the offset to first assigned member
Definition at line 55 of file TGo4HDF5DataHandle.cxx.
References fbDataSetActive, fiReadOffset, and fxType.
Referenced by TGo4HDF5Adapter::FillTypeInfo().
|
virtual |
Read event of sequence number from file.
Reimplemented in TGo4HDF5BasicDataHandle, TGo4HDF5CompositeDataHandle, TGo4HDF5SubVectorDataHandle, and TGo4HDF5VectorDataHandle.
Definition at line 158 of file TGo4HDF5DataHandle.cxx.
References TGo4HDF5DataHandle(), fbDataSetExists, fiEntries, fxFileSpace, fxSubcomponents, fxTypeName, go4hdfdatahandlethrow, go4hdfdbg, and Read().
Referenced by TGo4HDF5BasicDataHandle::Read(), Read(), TGo4HDF5SubVectorDataHandle::Read(), and TGo4HDF5VectorDataHandle::Read().
|
inline |
Definition at line 112 of file TGo4HDF5DataHandle.h.
References fbDataSetActive.
Referenced by TGo4HDF5SubVectorDataHandle::BuildReadDataset(), TGo4HDF5SubVectorDataHandle::BuildWriteDataset(), TGo4HDF5DataHandleFactory::CreateDataHandle(), SetAllSubMembersActive(), TGo4HDF5SubVectorDataHandle::SetObjectPointer(), and TGo4HDF5VectorDataHandle::Write().
void TGo4HDF5DataHandle::SetAllSubMembersActive | ( | Bool_t | on | ) |
Definition at line 90 of file TGo4HDF5DataHandle.cxx.
References TGo4HDF5DataHandle(), fxSubcomponents, SetActive(), and SetAllSubMembersActive().
Referenced by SetAllSubMembersActive(), and TGo4HDF5SubVectorDataHandle::SetObjectPointer().
|
inline |
type of the member to access from outside
Definition at line 86 of file TGo4HDF5DataHandle.h.
References fxMemberClass.
Referenced by TGo4HDF5Adapter::AddSubHandle(), and TGo4HDF5SubVectorDataHandle::SetObjectPointer().
|
inline |
identifier for the member to access from outside using the top event handle
Definition at line 83 of file TGo4HDF5DataHandle.h.
References fxMemberHandle.
Referenced by TGo4HDF5Adapter::AddSubHandle(), and TGo4HDF5SubVectorDataHandle::SetObjectPointer().
|
virtual |
define location of corresponding object in memory.
This is base pointer for all member specific offsets.
Reimplemented in TGo4HDF5SubVectorDataHandle, and TGo4HDF5VectorDataHandle.
Definition at line 99 of file TGo4HDF5DataHandle.cxx.
References TGo4HDF5DataHandle(), fiParentOffset, fxData, fxSubcomponents, fxTypeName, go4hdfdbg, and SetObjectPointer().
Referenced by TGo4HDF5Adapter::BuildDataType(), SetObjectPointer(), TGo4HDF5SubVectorDataHandle::SetObjectPointer(), and TGo4HDF5VectorDataHandle::SetObjectPointer().
|
inline |
remember location of this object relative to upper level object.
Definition at line 67 of file TGo4HDF5DataHandle.h.
References fiParentOffset.
Referenced by TGo4HDF5Adapter::AddSubHandle(), TGo4HDF5Adapter::BuildDataType(), and TGo4HDF5SubVectorDataHandle::SetObjectPointer().
void TGo4HDF5DataHandle::SetTopEvent | ( | TGo4EventElement * | eve | ) |
pass the top level event element down the member hierarchy.
Note that this is the "local" top event, e.g. the current Go4 composite subevent that owns the member
Definition at line 113 of file TGo4HDF5DataHandle.cxx.
References TGo4HDF5DataHandle(), fxEvent, fxSubcomponents, fxTypeName, go4hdfdbg, and SetTopEvent().
Referenced by TGo4HDF5Adapter::BuildDataType(), and SetTopEvent().
void TGo4HDF5DataHandle::SetTopEventClass | ( | const char * | classname | ) |
pass the top level event element class down the member hierarchy.
Note that this is the "local" top event, e.g. the current Go4 composite subevent that owns the member
Definition at line 126 of file TGo4HDF5DataHandle.cxx.
References TGo4HDF5DataHandle(), fxEventClass, fxSubcomponents, and SetTopEventClass().
Referenced by TGo4HDF5Adapter::BuildDataType(), and SetTopEventClass().
|
virtual |
Write event of sequence number from file.
Reimplemented in TGo4HDF5BasicDataHandle, TGo4HDF5CompositeDataHandle, TGo4HDF5SubVectorDataHandle, and TGo4HDF5VectorDataHandle.
Definition at line 189 of file TGo4HDF5DataHandle.cxx.
References TGo4HDF5DataHandle(), fbDataSetExists, fxDataSet, fxFileSpace, fxSubcomponents, fxTypeName, go4hdfdbg, and Write().
Referenced by TGo4HDF5BasicDataHandle::Write(), Write(), TGo4HDF5SubVectorDataHandle::Write(), and TGo4HDF5VectorDataHandle::Write().
|
protected |
we may disable this dataset temporarily from writing or reading useful for dynamic vector of vector components
Definition at line 173 of file TGo4HDF5DataHandle.h.
Referenced by TGo4HDF5DataHandle(), TGo4HDF5BasicDataHandle::BuildWriteDataset(), InsertTypeMember(), TGo4HDF5BasicDataHandle::Read(), TGo4HDF5VectorDataHandle::Read(), SetActive(), TGo4HDF5VectorDataHandle::SetObjectPointer(), TGo4HDF5BasicDataHandle::Write(), and TGo4HDF5VectorDataHandle::Write().
|
protected |
check on the fly if this handle has already created a dataset
Definition at line 169 of file TGo4HDF5DataHandle.h.
Referenced by TGo4HDF5DataHandle(), TGo4HDF5BasicDataHandle::BuildReadDataset(), TGo4HDF5BasicDataHandle::BuildWriteDataset(), TGo4HDF5VectorDataHandle::BuildWriteDataset(), Read(), and Write().
|
protected |
size of data structure in bytes, for redefining output dataset
Definition at line 145 of file TGo4HDF5DataHandle.h.
Referenced by TGo4HDF5DataHandle(), TGo4HDF5BasicDataHandle::AllocReadBuffer(), TGo4HDF5BasicDataHandle::BuildReadDataset(), and TGo4HDF5BasicDataHandle::Read().
|
protected |
number of event entries found in file dataspace
Definition at line 136 of file TGo4HDF5DataHandle.h.
Referenced by TGo4HDF5DataHandle(), TGo4HDF5BasicDataHandle::BuildReadDataset(), and Read().
|
protected |
offset of this data structure relative to top level event object
Definition at line 142 of file TGo4HDF5DataHandle.h.
Referenced by TGo4HDF5DataHandle(), SetObjectPointer(), and SetParentOffset().
|
protected |
begin of real eventdata payload after event object pointer
Definition at line 148 of file TGo4HDF5DataHandle.h.
Referenced by TGo4HDF5DataHandle(), InsertTypeMember(), and TGo4HDF5BasicDataHandle::Read().
|
protected |
pointer to begin of data in memory
Definition at line 139 of file TGo4HDF5DataHandle.h.
Referenced by TGo4HDF5DataHandle(), TGo4HDF5BasicDataHandle::BuildWriteDataset(), Data(), TGo4HDF5BasicDataHandle::Read(), TGo4HDF5VectorDataHandle::Read(), SetObjectPointer(), TGo4HDF5VectorDataHandle::SetObjectPointer(), and TGo4HDF5BasicDataHandle::Write().
|
protected |
dataset containing the structure
Definition at line 127 of file TGo4HDF5DataHandle.h.
Referenced by TGo4HDF5DataHandle(), ~TGo4HDF5DataHandle(), TGo4HDF5BasicDataHandle::BuildReadDataset(), TGo4HDF5BasicDataHandle::BuildWriteDataset(), TGo4HDF5VectorDataHandle::BuildWriteDataset(), TGo4HDF5BasicDataHandle::Read(), TGo4HDF5VectorDataHandle::Read(), TGo4HDF5BasicDataHandle::Write(), Write(), and TGo4HDF5VectorDataHandle::Write().
|
protected |
dataspace in memory
Definition at line 130 of file TGo4HDF5DataHandle.h.
Referenced by TGo4HDF5DataHandle(), ~TGo4HDF5DataHandle(), TGo4HDF5BasicDataHandle::BuildReadDataset(), TGo4HDF5BasicDataHandle::BuildWriteDataset(), TGo4HDF5VectorDataHandle::BuildWriteDataset(), TGo4HDF5BasicDataHandle::Read(), TGo4HDF5VectorDataHandle::Read(), TGo4HDF5BasicDataHandle::Write(), and TGo4HDF5VectorDataHandle::Write().
|
protected |
the top level event element to access the current data member from outside
Definition at line 160 of file TGo4HDF5DataHandle.h.
Referenced by TGo4HDF5DataHandle(), TGo4HDF5VectorDataHandle::Read(), and SetTopEvent().
|
protected |
the top level event element classname to access the current data member from outside
Definition at line 163 of file TGo4HDF5DataHandle.h.
Referenced by TGo4HDF5VectorDataHandle::Read(), and SetTopEventClass().
|
static |
Definition at line 116 of file TGo4HDF5DataHandle.h.
Referenced by AddSubMember().
|
protected |
dataspace in file
Definition at line 133 of file TGo4HDF5DataHandle.h.
Referenced by TGo4HDF5DataHandle(), TGo4HDF5BasicDataHandle::BuildReadDataset(), TGo4HDF5BasicDataHandle::Read(), Read(), TGo4HDF5VectorDataHandle::Read(), TGo4HDF5BasicDataHandle::Write(), Write(), and TGo4HDF5VectorDataHandle::Write().
|
protected |
classname of the entry for interpreter to operate e.g.
on variable length collection
Definition at line 157 of file TGo4HDF5DataHandle.h.
Referenced by TGo4HDF5VectorDataHandle::Read(), and SetMemberClass().
|
protected |
predefined interpreter access command e.g.
to operate e.g. on the variable length collection
Definition at line 154 of file TGo4HDF5DataHandle.h.
Referenced by TGo4HDF5VectorDataHandle::Read(), SetMemberName(), and TGo4HDF5SubVectorDataHandle::SetObjectPointer().
|
protected |
backpointer to parent source for exceptions
Definition at line 166 of file TGo4HDF5DataHandle.h.
Referenced by TGo4HDF5DataHandle(), TGo4HDF5BasicDataHandle::BuildReadDataset(), and TGo4HDF5SubVectorDataHandle::Read().
|
protected |
collect sub-components of the referenced data object
Definition at line 151 of file TGo4HDF5DataHandle.h.
Referenced by ~TGo4HDF5DataHandle(), AddSubMember(), BuildReadDataset(), BuildWriteDataset(), FindSubMember(), GetSubMember(), Read(), SetAllSubMembersActive(), SetObjectPointer(), SetTopEvent(), SetTopEventClass(), and Write().
|
protected |
component type representing the data structure
Definition at line 123 of file TGo4HDF5DataHandle.h.
Referenced by TGo4HDF5DataHandle(), TGo4HDF5VectorDataHandle::TGo4HDF5VectorDataHandle(), ~TGo4HDF5DataHandle(), TGo4HDF5BasicDataHandle::BuildReadDataset(), TGo4HDF5BasicDataHandle::BuildWriteDataset(), TGo4HDF5VectorDataHandle::BuildWriteDataset(), GetType(), InsertTypeMember(), TGo4HDF5BasicDataHandle::Read(), TGo4HDF5VectorDataHandle::Read(), TGo4HDF5BasicDataHandle::Write(), and TGo4HDF5VectorDataHandle::Write().
|
protected |
identifier of the dataset
Definition at line 120 of file TGo4HDF5DataHandle.h.
Referenced by TGo4HDF5DataHandle(), TGo4HDF5VectorDataHandle::TGo4HDF5VectorDataHandle(), TGo4HDF5BasicDataHandle::~TGo4HDF5BasicDataHandle(), TGo4HDF5CompositeDataHandle::~TGo4HDF5CompositeDataHandle(), ~TGo4HDF5DataHandle(), TGo4HDF5SubVectorDataHandle::~TGo4HDF5SubVectorDataHandle(), TGo4HDF5VectorDataHandle::~TGo4HDF5VectorDataHandle(), TGo4HDF5BasicDataHandle::BuildReadDataset(), TGo4HDF5BasicDataHandle::BuildWriteDataset(), TGo4HDF5SubVectorDataHandle::BuildWriteDataset(), TGo4HDF5VectorDataHandle::BuildWriteDataset(), GetTypeName(), Read(), TGo4HDF5SubVectorDataHandle::Read(), TGo4HDF5VectorDataHandle::Read(), SetObjectPointer(), SetTopEvent(), TGo4HDF5BasicDataHandle::Write(), Write(), and TGo4HDF5VectorDataHandle::Write().