Utopia  2
Framework for studying models of complex & adaptive systems.
Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
Utopia::DataIO::HDFObject< objectcategory > Class Template Reference

Common base class for all HDF5 classes in the DATAIO Module i.e., for all classes that wrap HDF5-C-Library functionality like HDFDataset, HDFGroup, HDFFile. This class is not intendet as something to be used independently, but only as a base class to be inherited from. More...

#include <hdfobject.hh>

Collaboration diagram for Utopia::DataIO::HDFObject< objectcategory >:
Collaboration graph
[legend]

Public Member Functions

void swap (HDFObject &other)
 swap the state of the caller with the state of the argument More...
 
std::string get_path () const
 Get the name or path object. More...
 
auto get_id_object () const
 Get the id object. More...
 
auto get_logger () const
 Get the logger object. More...
 
hid_t get_C_id () const
 Get the C id object. More...
 
auto get_refcount ()
 Get the reference count of object. More...
 
virtual bool is_valid () const
 Check if the object is still valid. More...
 
void close ()
 Close function which takes care of correctly closing the object and managing the reference counter. More...
 
void bind_to (hid_t id, std::function< herr_t(hid_t) > closing_func, std::string path={})
 Open the object and bind it to a HDF5 object identified by 'id' with name 'path'. Object should be created beforehand. More...
 
 HDFObject ()
 Construct HDFObject from the given arguments. More...
 
 HDFObject (HDFObject &&other)
 Construct HDFObject by moving. More...
 
 HDFObject (const HDFObject &other)=default
 Construct HDFObject by copying another object. More...
 
 HDFObject (hid_t id, std::function< herr_t(hid_t) > closing_func, std::string path={})
 Construct HDFObject from the given argument. More...
 
HDFObjectoperator= (const HDFObject &other)
 Copy assignment operator. More...
 
HDFObjectoperator= (HDFObject &&other)
 move assignment operator More...
 
virtual ~HDFObject ()
 Destroy the HDFObject object. Has to be implemented in subclass! More...
 

Static Public Attributes

static constexpr HDFCategory category = objectcategory
 Named variable for template arg. More...
 

Protected Attributes

HDFIdentifier _id
 Identifier object that binds an instance of this class to an HDF5 object. More...
 
std::string _path
 Name of the object. More...
 
std::shared_ptr< spdlog::logger > _log
 pointer to the logger for dataio More...
 

Detailed Description

template<HDFCategory objectcategory>
class Utopia::DataIO::HDFObject< objectcategory >

Common base class for all HDF5 classes in the DATAIO Module i.e., for all classes that wrap HDF5-C-Library functionality like HDFDataset, HDFGroup, HDFFile. This class is not intendet as something to be used independently, but only as a base class to be inherited from.

Template Parameters
HDFCategorytype of object an instance of this class refers to

Constructor & Destructor Documentation

◆ HDFObject() [1/4]

template<HDFCategory objectcategory>
Utopia::DataIO::HDFObject< objectcategory >::HDFObject ( )
inline

Construct HDFObject from the given arguments.

◆ HDFObject() [2/4]

template<HDFCategory objectcategory>
Utopia::DataIO::HDFObject< objectcategory >::HDFObject ( HDFObject< objectcategory > &&  other)
inline

Construct HDFObject by moving.

◆ HDFObject() [3/4]

template<HDFCategory objectcategory>
Utopia::DataIO::HDFObject< objectcategory >::HDFObject ( const HDFObject< objectcategory > &  other)
default

Construct HDFObject by copying another object.

◆ HDFObject() [4/4]

template<HDFCategory objectcategory>
Utopia::DataIO::HDFObject< objectcategory >::HDFObject ( hid_t  id,
std::function< herr_t(hid_t) >  closing_func,
std::string  path = {} 
)
inline

Construct HDFObject from the given argument.

Parameters
idC-Library identifier, by rvalue reference count. This is done such that the id is 'stolen' by this object and hence reference counts stay the same
pathName of the object

◆ ~HDFObject()

template<HDFCategory objectcategory>
virtual Utopia::DataIO::HDFObject< objectcategory >::~HDFObject ( )
inlinevirtual

Destroy the HDFObject object. Has to be implemented in subclass!

Member Function Documentation

◆ bind_to()

template<HDFCategory objectcategory>
void Utopia::DataIO::HDFObject< objectcategory >::bind_to ( hid_t  id,
std::function< herr_t(hid_t) >  closing_func,
std::string  path = {} 
)
inline

Open the object and bind it to a HDF5 object identified by 'id' with name 'path'. Object should be created beforehand.

Parameters
idid of the object to bind to, by rvalue reference. This is made such that the given id is 'stolen' by this object and reference count remains unchanged
pathName or path of the object to bind to

◆ close()

template<HDFCategory objectcategory>
void Utopia::DataIO::HDFObject< objectcategory >::close ( )
inline

Close function which takes care of correctly closing the object and managing the reference counter.

◆ get_C_id()

template<HDFCategory objectcategory>
hid_t Utopia::DataIO::HDFObject< objectcategory >::get_C_id ( ) const
inline

Get the C id object.

Returns
hid_t

◆ get_id_object()

template<HDFCategory objectcategory>
auto Utopia::DataIO::HDFObject< objectcategory >::get_id_object ( ) const
inline

Get the id object.

Returns
hid_t C-Library identifier held by this object

◆ get_logger()

template<HDFCategory objectcategory>
auto Utopia::DataIO::HDFObject< objectcategory >::get_logger ( ) const
inline

Get the logger object.

Returns
auto

◆ get_path()

template<HDFCategory objectcategory>
std::string Utopia::DataIO::HDFObject< objectcategory >::get_path ( ) const
inline

Get the name or path object.

Returns
std::string name of the object

◆ get_refcount()

template<HDFCategory objectcategory>
auto Utopia::DataIO::HDFObject< objectcategory >::get_refcount ( )
inline

Get the reference count of object.

Returns
auto

◆ is_valid()

template<HDFCategory objectcategory>
virtual bool Utopia::DataIO::HDFObject< objectcategory >::is_valid ( ) const
inlinevirtual

Check if the object is still valid.

Returns
true
false

Reimplemented in Utopia::DataIO::HDFType.

◆ operator=() [1/2]

template<HDFCategory objectcategory>
HDFObject& Utopia::DataIO::HDFObject< objectcategory >::operator= ( const HDFObject< objectcategory > &  other)
inline

Copy assignment operator.

Parameters
other
Returns
HDFObject&

◆ operator=() [2/2]

template<HDFCategory objectcategory>
HDFObject& Utopia::DataIO::HDFObject< objectcategory >::operator= ( HDFObject< objectcategory > &&  other)
inline

move assignment operator

Parameters
other
Returns
HDFObject&

◆ swap()

template<HDFCategory objectcategory>
void Utopia::DataIO::HDFObject< objectcategory >::swap ( HDFObject< objectcategory > &  other)
inline

swap the state of the caller with the state of the argument

Parameters
other

Member Data Documentation

◆ _id

template<HDFCategory objectcategory>
HDFIdentifier Utopia::DataIO::HDFObject< objectcategory >::_id
protected

Identifier object that binds an instance of this class to an HDF5 object.

◆ _log

template<HDFCategory objectcategory>
std::shared_ptr< spdlog::logger > Utopia::DataIO::HDFObject< objectcategory >::_log
protected

pointer to the logger for dataio

◆ _path

template<HDFCategory objectcategory>
std::string Utopia::DataIO::HDFObject< objectcategory >::_path
protected

Name of the object.

◆ category

template<HDFCategory objectcategory>
constexpr HDFCategory Utopia::DataIO::HDFObject< objectcategory >::category = objectcategory
staticconstexpr

Named variable for template arg.


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