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

Adapter class for io with hdf5 formatted file. More...

#include <TGo4HDF5Adapter.h>

+ Inheritance diagram for TGo4HDF5Adapter:

Public Member Functions

 TGo4HDF5Adapter ()
 
virtual ~TGo4HDF5Adapter ()
 

Static Public Member Functions

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.
 
static void FillTypeInfo (TGo4HDF5DataHandle *handle, const char *membername, const char *memtypename, size_t memberoffset=0, Int_t arraydim=0, TDataMember *member=nullptr)
 evaluate h5 type information for basic types of memtypename
 
static void FillTypeInfo (TGo4HDF5DataHandle *handle, TClass *rootclass, const char *basename=nullptr)
 evaluate h5 type information from root class streamer
 

Static Public Attributes

static const char * fgcFILESUF = ".h5"
 Standard suffix for file name.
 

Protected Member Functions

virtual void BuildDataSet (TGo4EventElement *event)=0
 initialize dataset from event structure
 
void BuildDataType (TGo4EventElement *event, TGo4HDF5DataHandle *parent=nullptr, Int_t index=0)
 Prepare data type from event structure for hdf5.
 
virtual void CloseFile ()
 opens the hdf5 file depending on the setup
 
UInt_t ConvertFileMode (Go4_H5_File_Flags flags)
 Convert common go4 filemode flags to hdf5 flags:
 
virtual void DeleteDataSet ()
 delete dataset resource
 
virtual void OpenFile (const char *fname=nullptr)=0
 opens the hdf5 file depending on the setup
 
size_t ScanEventSize (TGo4EventElement *event)
 evaluate total memory size of event object regarding composite subevents
 

Protected Attributes

Bool_t fbDataSetExists {kFALSE}
 True if branch already exists.
 
hsize_t fiFillCount {0}
 counter of filled events.
 
UInt_t fiFlags {0}
 remember file property flags.
 
TGo4EventElementfxEvent {nullptr}
 Points to event structure to be filled into dataset.
 
H5::H5File * fxFile {nullptr}
 the currently open hdf5 file
 
TGo4HDF5DataHandlefxHandle {nullptr}
 handle object to recursively treat the io of nested event components
 

Detailed Description

Adapter class for io with hdf5 formatted file.

  • Author
    J. Adamczewski-Musch
    Since
    5/2019

Definition at line 33 of file TGo4HDF5Adapter.h.

Constructor & Destructor Documentation

◆ TGo4HDF5Adapter()

◆ ~TGo4HDF5Adapter()

virtual TGo4HDF5Adapter::~TGo4HDF5Adapter ( )
inlinevirtual

Definition at line 41 of file TGo4HDF5Adapter.h.

Member Function Documentation

◆ AddSubHandle()

void TGo4HDF5Adapter::AddSubHandle ( TGo4HDF5DataHandle * handle,
const char * name,
const char * type,
size_t size,
size_t memberoffset,
const char * membername,
const char * classname,
TClass * valueclass )
static

Add subhandle to handle that represents a contained collection.

classname or valueclass, resp, refers to type of element in container,

Definition at line 57 of file TGo4HDF5Adapter.cxx.

References TGo4HDF5DataHandle::AddSubMember(), TGo4HDF5DataHandle::Data(), FillTypeInfo(), TGo4HDF5DataHandle::SetMemberClass(), TGo4HDF5DataHandle::SetMemberName(), and TGo4HDF5DataHandle::SetParentOffset().

Referenced by FillTypeInfo().

◆ BuildDataSet()

virtual void TGo4HDF5Adapter::BuildDataSet ( TGo4EventElement * event)
protectedpure virtual

initialize dataset from event structure

Implemented in TGo4HDF5Source, and TGo4HDF5Store.

◆ BuildDataType()

void TGo4HDF5Adapter::BuildDataType ( TGo4EventElement * event,
TGo4HDF5DataHandle * parent = nullptr,
Int_t index = 0 )
protected

Prepare data type from event structure for hdf5.

Return value is name of ROOT class that was used to compose the hdf5 type. In case of composite subevents, the current parent data handle and the index in array may be passed.

Definition at line 361 of file TGo4HDF5Adapter.cxx.

References TGo4HDF5DataHandle::AddSubMember(), BuildDataType(), TGo4HDF5DataHandle::Data(), TGo4Log::Error(), FillTypeInfo(), fxHandle, TGo4CompositeEvent::getEventElement(), TGo4CompositeEvent::getNElements(), TGo4HDF5DataHandle::GetTypeName(), go4hdfdbg, ScanEventSize(), TGo4HDF5DataHandle::SetObjectPointer(), TGo4HDF5DataHandle::SetParentOffset(), TGo4HDF5DataHandle::SetTopEvent(), and TGo4HDF5DataHandle::SetTopEventClass().

Referenced by TGo4HDF5Source::BuildDataSet(), TGo4HDF5Store::BuildDataSet(), and BuildDataType().

◆ CloseFile()

void TGo4HDF5Adapter::CloseFile ( )
protectedvirtual

opens the hdf5 file depending on the setup

Definition at line 29 of file TGo4HDF5Adapter.cxx.

References fxFile.

Referenced by TGo4HDF5Store::~TGo4HDF5Store(), TGo4HDF5Source::CloseCurrentFile(), TGo4HDF5Source::OpenFile(), and TGo4HDF5Store::OpenFile().

◆ ConvertFileMode()

UInt_t TGo4HDF5Adapter::ConvertFileMode ( Go4_H5_File_Flags flags)
protected

Convert common go4 filemode flags to hdf5 flags:

Definition at line 430 of file TGo4HDF5Adapter.cxx.

References GO4_H5F_ACC_EXCL, GO4_H5F_ACC_NONE, GO4_H5F_ACC_RDONLY, GO4_H5F_ACC_RDWR, and GO4_H5F_ACC_TRUNC.

Referenced by TGo4HDF5Store::TGo4HDF5Store().

◆ DeleteDataSet()

void TGo4HDF5Adapter::DeleteDataSet ( )
protectedvirtual

delete dataset resource

Reimplemented in TGo4HDF5Source.

Definition at line 38 of file TGo4HDF5Adapter.cxx.

References fbDataSetExists, and fxHandle.

Referenced by TGo4HDF5Store::~TGo4HDF5Store(), and TGo4HDF5Source::DeleteDataSet().

◆ FillTypeInfo() [1/2]

void TGo4HDF5Adapter::FillTypeInfo ( TGo4HDF5DataHandle * handle,
const char * membername,
const char * memtypename,
size_t memberoffset = 0,
Int_t arraydim = 0,
TDataMember * member = nullptr )
static

evaluate h5 type information for basic types of memtypename

Definition at line 258 of file TGo4HDF5Adapter.cxx.

References FillTypeInfo(), TGo4HDF5DataHandle::GetType(), go4hdfdbg, and TGo4HDF5DataHandle::InsertTypeMember().

◆ FillTypeInfo() [2/2]

void TGo4HDF5Adapter::FillTypeInfo ( TGo4HDF5DataHandle * handle,
TClass * rootclass,
const char * basename = nullptr )
static

evaluate h5 type information from root class streamer

Definition at line 78 of file TGo4HDF5Adapter.cxx.

References AddSubHandle(), TGo4HDF5DataHandle::Data(), FillTypeInfo(), and go4hdfdbg.

Referenced by AddSubHandle(), BuildDataType(), FillTypeInfo(), FillTypeInfo(), and TGo4HDF5SubVectorDataHandle::SetObjectPointer().

◆ OpenFile()

virtual void TGo4HDF5Adapter::OpenFile ( const char * fname = nullptr)
protectedpure virtual

opens the hdf5 file depending on the setup

Implemented in TGo4HDF5Source, and TGo4HDF5Store.

◆ ScanEventSize()

size_t TGo4HDF5Adapter::ScanEventSize ( TGo4EventElement * event)
protected

evaluate total memory size of event object regarding composite subevents

Definition at line 46 of file TGo4HDF5Adapter.cxx.

References go4hdfdbg.

Referenced by BuildDataType().

Field Documentation

◆ fbDataSetExists

Bool_t TGo4HDF5Adapter::fbDataSetExists {kFALSE}
protected

True if branch already exists.

Used for automatic creation of new event branch within Store method.

Definition at line 95 of file TGo4HDF5Adapter.h.

Referenced by TGo4HDF5Adapter(), TGo4HDF5Source::BuildDataSet(), TGo4HDF5Store::BuildDataSet(), and DeleteDataSet().

◆ fgcFILESUF

const char * TGo4HDF5Adapter::fgcFILESUF = ".h5"
static

Standard suffix for file name.

Definition at line 45 of file TGo4HDF5Adapter.h.

Referenced by TGo4HDF5Source::OpenFile(), TGo4HDF5Store::OpenFile(), and TGo4HDF5Source::ProducesFilesList().

◆ fiFillCount

hsize_t TGo4HDF5Adapter::fiFillCount {0}
protected

counter of filled events.

Definition at line 91 of file TGo4HDF5Adapter.h.

Referenced by TGo4HDF5Adapter(), TGo4HDF5Source::BuildEvent(), and TGo4HDF5Store::Store().

◆ fiFlags

UInt_t TGo4HDF5Adapter::fiFlags {0}
protected

remember file property flags.

Definition at line 101 of file TGo4HDF5Adapter.h.

Referenced by TGo4HDF5Adapter(), TGo4HDF5Store::TGo4HDF5Store(), and TGo4HDF5Store::OpenFile().

◆ fxEvent

TGo4EventElement* TGo4HDF5Adapter::fxEvent {nullptr}
protected

Points to event structure to be filled into dataset.

Definition at line 98 of file TGo4HDF5Adapter.h.

Referenced by TGo4HDF5Adapter(), TGo4HDF5Source::BuildEvent(), and TGo4HDF5Store::Store().

◆ fxFile

H5::H5File* TGo4HDF5Adapter::fxFile {nullptr}
protected

◆ fxHandle

TGo4HDF5DataHandle* TGo4HDF5Adapter::fxHandle {nullptr}
protected

handle object to recursively treat the io of nested event components

Definition at line 88 of file TGo4HDF5Adapter.h.

Referenced by TGo4HDF5Adapter(), TGo4HDF5Source::BuildDataSet(), TGo4HDF5Store::BuildDataSet(), BuildDataType(), TGo4HDF5Source::BuildEvent(), DeleteDataSet(), and TGo4HDF5Store::Store().


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