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

#include <h5_content_base.h>

Inheritance diagram for CNORXZ::hdf5::ContentBase:
CNORXZ::hdf5::Dataset CNORXZ::hdf5::Group CNORXZ::hdf5::Table CNORXZ::hdf5::SDataset< T > CNORXZ::hdf5::File CNORXZ::hdf5::STable< Ts >

Public Member Functions

 DEFAULT_MEMBERS (ContentBase)
 
 ContentBase (const String &_name, const ContentBase *_parent=nullptr)
 
virtual ~ContentBase ()=default
 
virtual ContentType type () const =0
 
virtual bool ro () const =0
 
virtual ContentBaseopen ()=0
 
virtual ContentBaseclose ()=0
 
virtual String path () const =0
 
virtual String filename () const =0
 
virtual bool exists () const =0
 
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 Attributes

String mName
 
const ContentBasemParent = nullptr
 
hid_t mId = 0
 

Detailed Description


Abstract base class for handling hdf5 objects.

Definition at line 40 of file h5_content_base.h.

Constructor & Destructor Documentation

◆ ContentBase()

CNORXZ::hdf5::ContentBase::ContentBase ( const String & _name,
const ContentBase * _parent = nullptr )

Construct the class.

Parameters
_nameContent name.
_parentParent content object. Leave null for the root object.

Definition at line 20 of file h5_content_base.cc.

◆ ~ContentBase()

virtual CNORXZ::hdf5::ContentBase::~ContentBase ( )
virtualdefault

Virtual default destructor.

Member Function Documentation

◆ addAttribute()

template<typename T >
ContentBase & CNORXZ::hdf5::ContentBase::addAttribute ( const String & name,
const T & value )

Add attribute to this object.

Template Parameters
TAttribute value type.
Parameters
nameAttribute name.
valueAttribute value.

Definition at line 98 of file h5_content_base.cc.h.

◆ attributeExists()

bool CNORXZ::hdf5::ContentBase::attributeExists ( const String & name) const

Check if attribute of given name exists in this object.

Parameters
nameAttribute name.
Returns
True if attribute exists else false.

Definition at line 111 of file h5_content_base.cc.

◆ close()

virtual ContentBase & CNORXZ::hdf5::ContentBase::close ( )
pure virtual

Close object.

Returns
Reference to this object.

Implemented in CNORXZ::hdf5::Group, CNORXZ::hdf5::Dataset, CNORXZ::hdf5::File, and CNORXZ::hdf5::Table.

◆ DEFAULT_MEMBERS()

CNORXZ::hdf5::ContentBase::DEFAULT_MEMBERS ( ContentBase )

Default constructors and assignments.

◆ exists()

virtual bool CNORXZ::hdf5::ContentBase::exists ( ) const
pure virtual

Check if group exists in the parent object.

Returns
True if object exists, else false.

Implemented in CNORXZ::hdf5::Group, CNORXZ::hdf5::Dataset, CNORXZ::hdf5::File, and CNORXZ::hdf5::Table.

◆ filename()

virtual String CNORXZ::hdf5::ContentBase::filename ( ) const
pure virtual

Get the file name.

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

Implemented in CNORXZ::hdf5::Group, CNORXZ::hdf5::Dataset, CNORXZ::hdf5::File, and CNORXZ::hdf5::Table.

◆ getAttribute()

DType CNORXZ::hdf5::ContentBase::getAttribute ( const String & name) const

Get an attribute of this object.

Parameters
nameAttribute name.
Returns
The attribute value as DType.

Definition at line 44 of file h5_content_base.cc.

◆ getAttributes()

std::map< String, DType > CNORXZ::hdf5::ContentBase::getAttributes ( ) const

Get all attributes of this object.

Returns
Std map of key-value pairs.

Definition at line 119 of file h5_content_base.cc.

◆ getRecursiveAttributes()

std::map< String, DType > CNORXZ::hdf5::ContentBase::getRecursiveAttributes ( ) const

Get all attributes of this object and all its parent objects, recursively.

Returns
Std map of key-value pairs.

Definition at line 141 of file h5_content_base.cc.

◆ id()

hid_t CNORXZ::hdf5::ContentBase::id ( ) const

Get object id.

Returns
hdf5 id of the h5 object maintained by this object.

Definition at line 34 of file h5_content_base.cc.

◆ isOpen()

bool CNORXZ::hdf5::ContentBase::isOpen ( ) const

Check if object is open, i.e. if there is a valid hdf5 id.

Returns
True if object is open else false.

Definition at line 39 of file h5_content_base.cc.

◆ name()

const String & CNORXZ::hdf5::ContentBase::name ( ) const

Get object name.

Returns
The name of this object.

Definition at line 24 of file h5_content_base.cc.

◆ open()

virtual ContentBase & CNORXZ::hdf5::ContentBase::open ( )
pure virtual

Open object.

Returns
Reference to this object.

Implemented in CNORXZ::hdf5::Group, CNORXZ::hdf5::Dataset, CNORXZ::hdf5::File, and CNORXZ::hdf5::Table.

◆ parent()

const ContentBase * CNORXZ::hdf5::ContentBase::parent ( ) const

Get parent object.

Returns
Pointer to the parent of this object.

Definition at line 29 of file h5_content_base.cc.

◆ path()

virtual String CNORXZ::hdf5::ContentBase::path ( ) const
pure virtual

Get object path.

Returns
Absolute hdf5 file internal path of this object.

Implemented in CNORXZ::hdf5::Group, CNORXZ::hdf5::Dataset, CNORXZ::hdf5::File, and CNORXZ::hdf5::Table.

◆ ro()

virtual bool CNORXZ::hdf5::ContentBase::ro ( ) const
pure virtual

Check if in read-only mode

Returns
True if read-only else false.

Implemented in CNORXZ::hdf5::Group, CNORXZ::hdf5::Dataset, CNORXZ::hdf5::File, and CNORXZ::hdf5::Table.

◆ type()

virtual ContentType CNORXZ::hdf5::ContentBase::type ( ) const
pure virtual

Get the content type.

Returns
Content type.

Implemented in CNORXZ::hdf5::Group, CNORXZ::hdf5::Dataset, CNORXZ::hdf5::File, and CNORXZ::hdf5::Table.

Member Data Documentation

◆ mId

hid_t CNORXZ::hdf5::ContentBase::mId = 0
protected

hdf5 identifier of the hdf5 object handled by this object.

Definition at line 142 of file h5_content_base.h.

◆ mName

String CNORXZ::hdf5::ContentBase::mName
protected

Name of this object.

Definition at line 140 of file h5_content_base.h.

◆ mParent

const ContentBase* CNORXZ::hdf5::ContentBase::mParent = nullptr
protected

Pointer to this object's parent.

Definition at line 141 of file h5_content_base.h.


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