GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
TGo4HDF5Adapter Class Referenceabstract

#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)
 
static void FillTypeInfo (TGo4HDF5DataHandle *handle, TClass *rootclass, const char *basename=nullptr)
 
static void FillTypeInfo (TGo4HDF5DataHandle *handle, const char *membername, const char *memtypename, size_t memberoffset=0, Int_t arraydim=0, TDataMember *member=nullptr)
 

Static Public Attributes

static const char * fgcFILESUF = ".h5"
 

Protected Member Functions

virtual void OpenFile (const char *fname=nullptr)=0
 
virtual void CloseFile ()
 
virtual void BuildDataSet (TGo4EventElement *event)=0
 
virtual void DeleteDataSet ()
 
void BuildDataType (TGo4EventElement *event, TGo4HDF5DataHandle *parent=nullptr, Int_t index=0)
 
size_t ScanEventSize (TGo4EventElement *event)
 
UInt_t ConvertFileMode (Go4_H5_File_Flags flags)
 

Protected Attributes

H5::H5File * fxFile {nullptr}
 
TGo4HDF5DataHandlefxHandle {nullptr}
 
hsize_t fiFillCount {0}
 
Bool_t fbDataSetExists {kFALSE}
 
TGo4EventElementfxEvent {nullptr}
 
UInt_t fiFlags {0}
 

Detailed Description

Adapter class for io with hdf5 formatted file

Definition at line 35 of file TGo4HDF5Adapter.h.

Constructor & Destructor Documentation

◆ TGo4HDF5Adapter()

TGo4HDF5Adapter::TGo4HDF5Adapter ( )
inline

Definition at line 38 of file TGo4HDF5Adapter.h.

◆ ~TGo4HDF5Adapter()

virtual TGo4HDF5Adapter::~TGo4HDF5Adapter ( )
inlinevirtual

Definition at line 43 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 containend 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 TGo4HDF5Store, and TGo4HDF5Source.

◆ 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(), 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(), and TGo4HDF5Store::BuildDataSet().

◆ 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 TGo4HDF5Source::CloseCurrentFile(), TGo4HDF5Source::OpenFile(), TGo4HDF5Store::OpenFile(), and TGo4HDF5Store::~TGo4HDF5Store().

◆ 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 TGo4HDF5Source::DeleteDataSet(), and TGo4HDF5Store::~TGo4HDF5Store().

◆ FillTypeInfo() [1/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(), and go4hdfdbg.

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

◆ FillTypeInfo() [2/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().

◆ OpenFile()

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

opens the hdf5 file depending on the setup

Implemented in TGo4HDF5Store, and TGo4HDF5Source.

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

Member Data 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 102 of file TGo4HDF5Adapter.h.

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

◆ fgcFILESUF

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

Standard suffix for file name

Definition at line 47 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 97 of file TGo4HDF5Adapter.h.

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

◆ fiFlags

UInt_t TGo4HDF5Adapter::fiFlags {0}
protected

remember file property flags?.

Definition at line 108 of file TGo4HDF5Adapter.h.

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

◆ fxEvent

TGo4EventElement* TGo4HDF5Adapter::fxEvent {nullptr}
protected

Points to event structure to be filled into dataset.

Definition at line 105 of file TGo4HDF5Adapter.h.

Referenced by 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 94 of file TGo4HDF5Adapter.h.

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


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