CNORXZ
Container with Native Operation Routines and Expressions
Loading...
Searching...
No Matches
Public Member Functions | List of all members
CNORXZ::hdf5::STable< Ts > Class Template Reference

#include <h5_table.h>

Inheritance diagram for CNORXZ::hdf5::STable< Ts >:
CNORXZ::hdf5::Table CNORXZ::hdf5::ContentBase

Public Member Functions

 DEFAULT_MEMBERS (STable)
 
 STable (const String &name, const ContentBase *_parent)
 
 STable (const String &name, const ContentBase *_parent, const Arr< String, sizeof...(Ts)> &fnames)
 
STableinitFields (const Arr< String, sizeof...(Ts)> &fnames)
 
STableappendRecord (const Tuple< Ts... > &t)
 
STableappendRecord (const MArray< Tuple< Ts... > > &t)
 
MArray< Tuple< Ts... > > read () const
 
template<class F >
decltype(autoiterRecords (F &&f) const
 
- Public Member Functions inherited from CNORXZ::hdf5::Table
 DEFAULT_MEMBERS (Table)
 
 Table (const String &name, const ContentBase *_parent)
 
 ~Table ()
 
virtual ContentType type () const override final
 
virtual bool ro () const override final
 
virtual Tableopen () override final
 
virtual Tableclose () override final
 
virtual String path () const override final
 
virtual String filename () const override final
 
virtual bool exists () const override final
 
TableinitFieldNames (const Vector< String > &fnames)
 
TableinitTable (SizeT n, const void *data, SizeT dsize, SizeT chunk_size)
 
TableappendRecords (SizeT n, const void *data)
 
TablereadRecords (SizeT pos, SizeT n, char *data)
 
MArray< DTypereadRecord (SizeT pos) const
 
MArray< DTyperead () const
 
template<class F >
decltype(autoiterRecords (F &&f) const
 
const RangePtrfields () const
 
const RangePtrrecords () const
 
- Public Member Functions inherited from CNORXZ::hdf5::ContentBase
 DEFAULT_MEMBERS (ContentBase)
 
 ContentBase (const String &_name, const ContentBase *_parent=nullptr)
 
virtual ~ContentBase ()=default
 
const Stringname () const
 
const ContentBaseparent () const
 
hid_t id () const
 
bool isOpen () const
 
template<typename T >
ContentBaseaddAttribute (const String &name, const T &value)
 
DType getAttribute (const String &name) const
 
bool attributeExists (const String &name) const
 
std::map< String, DTypegetAttributes () const
 
std::map< String, DTypegetRecursiveAttributes () const
 

Additional Inherited Members

- Public Types inherited from CNORXZ::hdf5::Table
typedef std::pair< SizeT, StringFieldID
 
- Protected Member Functions inherited from CNORXZ::hdf5::Table
void mkTypes ()
 
- Protected Attributes inherited from CNORXZ::hdf5::Table
RangePtr mRecords
 
RangePtr mFields
 
MArray< SizeTmSizes
 
MArray< SizeTmOffsets
 
MArray< hid_tmTypes
 
hid_t mType = 0
 
SizeT mTypesize = 0
 
MArray< std::function< DType(const char *)> mInterpret )
 
- Protected Attributes inherited from CNORXZ::hdf5::ContentBase
String mName
 
const ContentBasemParent = nullptr
 
hid_t mId = 0
 

Detailed Description

template<typename... Ts>
class CNORXZ::hdf5::STable< Ts >

Class to handle hdf5 tables, the record type is known at compile time. The records are accessed by a std tuple. Caution: The ordering of the record entries is fixed by their memory location. The std tuple has a reverse ordering w.r.t. the memory location, i.e. a record with element types T1-T2-T3 (memory ordering) and field names "T1", "T2", "T3", requires template argumens <T3,T2,T1>.

Template Parameters
TsRecord element types.

Definition at line 125 of file h5_table.h.

Constructor & Destructor Documentation

◆ STable() [1/2]

template<typename... Ts>
CNORXZ::hdf5::STable< Ts >::STable ( const String & name,
const ContentBase * _parent )

Construct the class.

Parameters
nameTable name.
_parentParent content object.

Definition at line 41 of file h5_table.cc.h.

◆ STable() [2/2]

template<typename... Ts>
CNORXZ::hdf5::STable< Ts >::STable ( const String & name,
const ContentBase * _parent,
const Arr< String, sizeof...(Ts)> & fnames )

Construct the class.

Parameters
nameTable name.
_parentParent content object.
fnamesField names.

Definition at line 67 of file h5_table.cc.h.

Member Function Documentation

◆ appendRecord() [1/2]

template<typename... Ts>
STable & CNORXZ::hdf5::STable< Ts >::appendRecord ( const MArray< Tuple< Ts... > > & t)

Append records to the table.

Parameters
tArray of tuples containing the records.

◆ appendRecord() [2/2]

template<typename... Ts>
STable< Ts... > & CNORXZ::hdf5::STable< Ts >::appendRecord ( const Tuple< Ts... > & t)

Append record to the table.

Parameters
tTuple containing the record entries.

Definition at line 105 of file h5_table.cc.h.

◆ DEFAULT_MEMBERS()

template<typename... Ts>
CNORXZ::hdf5::STable< Ts >::DEFAULT_MEMBERS ( STable< Ts > )

Default constructors and assignments.

◆ initFields()

template<typename... Ts>
STable< Ts... > & CNORXZ::hdf5::STable< Ts >::initFields ( const Arr< String, sizeof...(Ts)> & fnames)

Ininitialize and setup table fields.

Parameters
fnamesTable field names.

Definition at line 75 of file h5_table.cc.h.

◆ iterRecords()

template<typename... Ts>
template<class F >
decltype(auto) CNORXZ::hdf5::STable< Ts >::iterRecords ( F && f) const

Iterate over all table records.

Parameters
fFunction object to be executed on each record.

Definition at line 34 of file h5_table.cc.h.

◆ read()

template<typename... Ts>
MArray< Tuple< Ts... > > CNORXZ::hdf5::STable< Ts >::read ( ) const

Read the table.

Returns
Array of tuples containing the records.

Definition at line 118 of file h5_table.cc.h.


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