Utopia  2
Framework for studying models of complex & adaptive systems.
Public Types | Public Member Functions | List of all members
Utopia::DataIO::HDFGroup Class Referencefinal

Class represting a HDFGroup, an object analogous to a folder for HDFFiles. More...

#include <hdfgroup.hh>

Inheritance diagram for Utopia::DataIO::HDFGroup:
Inheritance graph
[legend]
Collaboration diagram for Utopia::DataIO::HDFGroup:
Collaboration graph
[legend]

Public Types

using Base = HDFObject< HDFCategory::group >
 

Public Member Functions

template<typename Attrdata >
void add_attribute (std::string name, Attrdata attribute_data)
 write attribute More...
 
template<HDFCategory cat>
void open (HDFObject< cat > &parent, std::string path)
 Bind the object to a new HDF5 Group, either opening existing or creating a new one at path 'path' in the HDF5 group 'parent'. More...
 
std::shared_ptr< HDFGroupopen_group (std::string path)
 Opens a group. More...
 
std::shared_ptr< HDFDatasetopen_dataset (std::string path, std::vector< hsize_t > capacity={}, std::vector< hsize_t > chunksizes={}, std::size_t compresslevel=0)
 open a HDFDataset More...
 
void delete_group (std::string path)
 Delete the group at the given relative path. More...
 
 HDFGroup ()=default
 Default constructor. More...
 
 HDFGroup (const HDFGroup &other)=default
 Construct a new HDFGroup object. More...
 
 HDFGroup (HDFGroup &&other)=default
 Construct a new HDFGroup object. More...
 
HDFGroupoperator= (HDFGroup &&other)=default
 assignment operator More...
 
HDFGroupoperator= (const HDFGroup &other)=default
 Copy assignment operator. More...
 
template<HDFCategory cat>
 HDFGroup (HDFObject< cat > &parent, std::string path)
 Construct a new HDFGroup object. More...
 
virtual ~HDFGroup ()=default
 Destroy the HDFGroup object. More...
 
- Public Member Functions inherited from Utopia::DataIO::HDFObject< HDFCategory::group >
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...
 

Additional Inherited Members

- Static Public Attributes inherited from Utopia::DataIO::HDFObject< HDFCategory::group >
static constexpr HDFCategory category
 Named variable for template arg. More...
 
- Protected Attributes inherited from Utopia::DataIO::HDFObject< HDFCategory::group >
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

Class represting a HDFGroup, an object analogous to a folder for HDFFiles.

Member Typedef Documentation

◆ Base

Constructor & Destructor Documentation

◆ HDFGroup() [1/4]

Utopia::DataIO::HDFGroup::HDFGroup ( )
default

Default constructor.

◆ HDFGroup() [2/4]

Utopia::DataIO::HDFGroup::HDFGroup ( const HDFGroup other)
default

Construct a new HDFGroup object.

Parameters
otherThe other

◆ HDFGroup() [3/4]

Utopia::DataIO::HDFGroup::HDFGroup ( HDFGroup &&  other)
default

Construct a new HDFGroup object.

Parameters
otherThe other

◆ HDFGroup() [4/4]

template<HDFCategory cat>
Utopia::DataIO::HDFGroup::HDFGroup ( HDFObject< cat > &  parent,
std::string  path 
)
inline

Construct a new HDFGroup object.

Parameters
parentThe parent group to create or open the group in
nameThe name of the group
Template Parameters
HDFObject{ description }

◆ ~HDFGroup()

virtual Utopia::DataIO::HDFGroup::~HDFGroup ( )
virtualdefault

Destroy the HDFGroup object.

Member Function Documentation

◆ add_attribute()

template<typename Attrdata >
void Utopia::DataIO::HDFGroup::add_attribute ( std::string  name,
Attrdata  attribute_data 
)
inline

write attribute

Parameters
nameThe name
attribute_dataThe attribute data
Template Parameters
Attrdatatype of attribute data

◆ delete_group()

void Utopia::DataIO::HDFGroup::delete_group ( std::string  path)
inline

Delete the group at the given relative path.

Parameters
pathrelative path to group to delete

◆ open()

template<HDFCategory cat>
void Utopia::DataIO::HDFGroup::open ( HDFObject< cat > &  parent,
std::string  path 
)
inline

Bind the object to a new HDF5 Group, either opening existing or creating a new one at path 'path' in the HDF5 group 'parent'.

Parameters
parent
path

◆ open_dataset()

std::shared_ptr< HDFDataset > Utopia::DataIO::HDFGroup::open_dataset ( std::string  path,
std::vector< hsize_t >  capacity = {},
std::vector< hsize_t >  chunksizes = {},
std::size_t  compresslevel = 0 
)
inline

open a HDFDataset

Template Parameters
HDFDatasetdataset type with parent type
Parameters
pathThe path of the HDFDataset
Returns
A std::shared_ptr pointing at the newly created dataset

◆ open_group()

std::shared_ptr< HDFGroup > Utopia::DataIO::HDFGroup::open_group ( std::string  path)
inline

Opens a group.

Parameters
pathThe path to open
Returns
std::shared_ptr<HDFGroup>

◆ operator=() [1/2]

HDFGroup& Utopia::DataIO::HDFGroup::operator= ( const HDFGroup other)
default

Copy assignment operator.

Parameters
other
Returns
HDFGroup&

◆ operator=() [2/2]

HDFGroup& Utopia::DataIO::HDFGroup::operator= ( HDFGroup &&  other)
default

assignment operator

Parameters
otherThe other
Returns
HDFGroup&

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