CNORXZ
Container with Native Operation Routines and Expressions
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CNORXZ::hdf5::Table Class Reference

#include <h5_table.h>

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

Public Types

typedef std::pair< SizeT, StringFieldID
 

Public Member Functions

 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
 

Protected Member Functions

void mkTypes ()
 

Protected Attributes

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


Class to handle hdf5 tables.

Definition at line 25 of file h5_table.h.

Member Typedef Documentation

◆ FieldID

Meta data type of fields range.

Definition at line 28 of file h5_table.h.

Constructor & Destructor Documentation

◆ Table()

CNORXZ::hdf5::Table::Table ( const String & name,
const ContentBase * _parent )

Construct the class.

Parameters
nameTable name.
_parentParent content object.

Definition at line 19 of file h5_table.cc.

◆ ~Table()

CNORXZ::hdf5::Table::~Table ( )

Destructor. Release all involved hdf5 ids.

Definition at line 58 of file h5_table.cc.

Member Function Documentation

◆ appendRecords()

Table & CNORXZ::hdf5::Table::appendRecords ( SizeT n,
const void * data )

Append records to the table.

Parameters
nNumber of records to append.
dataRecords data.

Definition at line 137 of file h5_table.cc.

◆ close()

Table & CNORXZ::hdf5::Table::close ( )
finaloverridevirtual

Close object.

Returns
Reference to this object.

Implements CNORXZ::hdf5::ContentBase.

Definition at line 83 of file h5_table.cc.

◆ DEFAULT_MEMBERS()

CNORXZ::hdf5::Table::DEFAULT_MEMBERS ( Table )

Default constructors and assignments.

◆ exists()

bool CNORXZ::hdf5::Table::exists ( ) const
finaloverridevirtual

Check if group exists in the parent object.

Returns
True if object exists, else false.

Implements CNORXZ::hdf5::ContentBase.

Definition at line 103 of file h5_table.cc.

◆ fields()

const RangePtr & CNORXZ::hdf5::Table::fields ( ) const

Get fields range.

Returns
Pointer to the range.

Definition at line 184 of file h5_table.cc.

◆ filename()

String CNORXZ::hdf5::Table::filename ( ) const
finaloverridevirtual

Get the file name.

Returns
Name of the hdf5 file this object is stored in.

Implements CNORXZ::hdf5::ContentBase.

Definition at line 98 of file h5_table.cc.

◆ initFieldNames()

Table & CNORXZ::hdf5::Table::initFieldNames ( const Vector< String > & fnames)

Ininitialize table field names.

Parameters
fnamesTable field names.

Definition at line 108 of file h5_table.cc.

◆ initTable()

Table & CNORXZ::hdf5::Table::initTable ( SizeT n,
const void * data,
SizeT dsize,
SizeT chunk_size )

Initialize the table.

Parameters
nNumber of records (rows).
dataTable data.
dsizeRecord type size.
chunk_sizeChunk size.

Definition at line 120 of file h5_table.cc.

◆ iterRecords()

template<class F >
decltype(auto) CNORXZ::hdf5::Table::iterRecords ( F && f) const

Iterate over table records.

Parameters
ffunction object to be executed on each table record.

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

◆ mkTypes()

void CNORXZ::hdf5::Table::mkTypes ( )
protected

Type setup function.

Definition at line 194 of file h5_table.cc.

◆ open()

Table & CNORXZ::hdf5::Table::open ( )
finaloverridevirtual

Open object.

Returns
Reference to this object.

Implements CNORXZ::hdf5::ContentBase.

Definition at line 73 of file h5_table.cc.

◆ path()

String CNORXZ::hdf5::Table::path ( ) const
finaloverridevirtual

Get object path.

Returns
Absolute hdf5 file internal path of this object.

Implements CNORXZ::hdf5::ContentBase.

Definition at line 93 of file h5_table.cc.

◆ read()

MArray< DType > CNORXZ::hdf5::Table::read ( ) const

Read table.

Returns
DType array containing the table data.

Definition at line 168 of file h5_table.cc.

◆ readRecord()

MArray< DType > CNORXZ::hdf5::Table::readRecord ( SizeT pos) const

Read record.

Parameters
posNumber of the record to be read.
Returns
DType array with containing the record data.

Definition at line 153 of file h5_table.cc.

◆ readRecords()

Table & CNORXZ::hdf5::Table::readRecords ( SizeT pos,
SizeT n,
char * data )

Read records.

Parameters
posNumber of first record to read.
nNumber of records to read.
dataTarget pointer.

Definition at line 146 of file h5_table.cc.

◆ records()

const RangePtr & CNORXZ::hdf5::Table::records ( ) const

Get records range.

Returns
Pointer to the range.

Definition at line 189 of file h5_table.cc.

◆ ro()

bool CNORXZ::hdf5::Table::ro ( ) const
finaloverridevirtual

Check if in read-only mode

Returns
True if read-only else false.

Implements CNORXZ::hdf5::ContentBase.

Definition at line 68 of file h5_table.cc.

◆ type()

ContentType CNORXZ::hdf5::Table::type ( ) const
finaloverridevirtual

Get the content type.

Returns
Content type.

Implements CNORXZ::hdf5::ContentBase.

Definition at line 63 of file h5_table.cc.

Member Data Documentation

◆ mFields

RangePtr CNORXZ::hdf5::Table::mFields
protected

Fields range.

Definition at line 104 of file h5_table.h.

◆ mInterpret

MArray<std::function<DType(const char*)> CNORXZ::hdf5::Table::mInterpret)
protected

Field element type interpreting functions.

Definition at line 110 of file h5_table.h.

◆ mOffsets

MArray<SizeT> CNORXZ::hdf5::Table::mOffsets
protected

Field element offsets.

Definition at line 106 of file h5_table.h.

◆ mRecords

RangePtr CNORXZ::hdf5::Table::mRecords
protected

Records range.

Definition at line 103 of file h5_table.h.

◆ mSizes

MArray<SizeT> CNORXZ::hdf5::Table::mSizes
protected

Field element type sizes.

Definition at line 105 of file h5_table.h.

◆ mType

hid_t CNORXZ::hdf5::Table::mType = 0
protected

Record type id.

Definition at line 108 of file h5_table.h.

◆ mTypes

MArray<hid_t> CNORXZ::hdf5::Table::mTypes
protected

Field element type ids.

Definition at line 107 of file h5_table.h.

◆ mTypesize

SizeT CNORXZ::hdf5::Table::mTypesize = 0
protected

Record type size.

Definition at line 109 of file h5_table.h.


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