GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4HDF5DataHandle Class Reference

The base class to access a datatype with substructures in hdf5. More...

#include <TGo4HDF5DataHandle.h>

+ Inheritance diagram for TGo4HDF5DataHandle:

Public Member Functions

 TGo4HDF5DataHandle (const char *name, size_t datasize)
 create new data handle
 
virtual ~TGo4HDF5DataHandle ()
 
TGo4HDF5DataHandleAddSubMember (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
 
TGo4HDF5DataHandleFindSubMember (const char *name)
 lookup if subcomponent of name already is in list.
 
TGo4HDF5DataHandleGetSubMember (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
 
TGo4EventElementfxEvent {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.
 
TGo4HDF5SourcefxParentSource {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
 

Detailed Description

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

  • *
    Author
    J. Adamczewski-Musch
    Since
    6/2019

Definition at line 48 of file TGo4HDF5DataHandle.h.

Constructor & Destructor Documentation

◆ TGo4HDF5DataHandle()

◆ ~TGo4HDF5DataHandle()

TGo4HDF5DataHandle::~TGo4HDF5DataHandle ( )
virtual

Member Function Documentation

◆ AddSubMember()

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().

◆ BuildReadDataset()

void TGo4HDF5DataHandle::BuildReadDataset ( H5::H5File * file,
TGo4HDF5Source * parent )
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().

◆ BuildWriteDataset()

void TGo4HDF5DataHandle::BuildWriteDataset ( H5::H5File * file)
virtual

◆ Data()

void * TGo4HDF5DataHandle::Data ( ) const
inline

◆ FindSubMember()

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().

◆ GetSubMember()

TGo4HDF5DataHandle * TGo4HDF5DataHandle::GetSubMember ( UInt_t ix)
inline

Definition at line 106 of file TGo4HDF5DataHandle.h.

References TGo4HDF5DataHandle(), and fxSubcomponents.

◆ GetType()

H5::CompType * TGo4HDF5DataHandle::GetType ( ) const
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().

◆ GetTypeName()

const char * TGo4HDF5DataHandle::GetTypeName ( ) const
inline

◆ InsertTypeMember()

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().

◆ Read()

void TGo4HDF5DataHandle::Read ( hsize_t sequencenum,
H5::H5File * file )
virtual

◆ SetActive()

◆ SetAllSubMembersActive()

void TGo4HDF5DataHandle::SetAllSubMembersActive ( Bool_t on)

◆ SetMemberClass()

void TGo4HDF5DataHandle::SetMemberClass ( const char * clname)
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().

◆ SetMemberName()

void TGo4HDF5DataHandle::SetMemberName ( const char * name)
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().

◆ SetObjectPointer()

void TGo4HDF5DataHandle::SetObjectPointer ( void * memptr)
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().

◆ SetParentOffset()

void TGo4HDF5DataHandle::SetParentOffset ( size_t off)
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().

◆ SetTopEvent()

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().

◆ SetTopEventClass()

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().

◆ Write()

void TGo4HDF5DataHandle::Write ( hsize_t sequencenum,
H5::H5File * file )
virtual

Field Documentation

◆ fbDataSetActive

Bool_t TGo4HDF5DataHandle::fbDataSetActive {kFALSE}
protected

◆ fbDataSetExists

Bool_t TGo4HDF5DataHandle::fbDataSetExists {kFALSE}
protected

◆ fiDataSize

size_t TGo4HDF5DataHandle::fiDataSize {0}
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().

◆ fiEntries

ULong_t TGo4HDF5DataHandle::fiEntries {0}
protected

number of event entries found in file dataspace

Definition at line 136 of file TGo4HDF5DataHandle.h.

Referenced by TGo4HDF5DataHandle(), TGo4HDF5BasicDataHandle::BuildReadDataset(), and Read().

◆ fiParentOffset

size_t TGo4HDF5DataHandle::fiParentOffset {0}
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().

◆ fiReadOffset

size_t TGo4HDF5DataHandle::fiReadOffset {0}
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().

◆ fxData

◆ fxDataSet

◆ fxDataSpace

◆ fxEvent

TGo4EventElement* TGo4HDF5DataHandle::fxEvent {nullptr}
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().

◆ fxEventClass

TString TGo4HDF5DataHandle::fxEventClass
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().

◆ fxFactory

TGo4HDF5DataHandleFactory TGo4HDF5DataHandle::fxFactory
static

Definition at line 116 of file TGo4HDF5DataHandle.h.

Referenced by AddSubMember().

◆ fxFileSpace

◆ fxMemberClass

TString TGo4HDF5DataHandle::fxMemberClass
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().

◆ fxMemberHandle

TString TGo4HDF5DataHandle::fxMemberHandle
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().

◆ fxParentSource

TGo4HDF5Source* TGo4HDF5DataHandle::fxParentSource {nullptr}
protected

backpointer to parent source for exceptions

Definition at line 166 of file TGo4HDF5DataHandle.h.

Referenced by TGo4HDF5DataHandle(), TGo4HDF5BasicDataHandle::BuildReadDataset(), and TGo4HDF5SubVectorDataHandle::Read().

◆ fxSubcomponents

std::vector<TGo4HDF5DataHandle *> TGo4HDF5DataHandle::fxSubcomponents
protected

◆ fxType

◆ fxTypeName


The documentation for this class was generated from the following files: