Nektar++
Public Member Functions | Protected Member Functions | Private Member Functions | Friends | List of all members
Nektar::LibUtilities::H5::Group Class Reference

HDF5 Group wrapper. More...

#include <H5.h>

Inheritance diagram for Nektar::LibUtilities::H5::Group:
[legend]

Public Member Functions

 ~Group () override
 
std::vector< std::string > GetElementNames ()
 
CanHaveAttributesSharedPtr operator[] (hsize_t idx)
 
CanHaveAttributesSharedPtr operator[] (const std::string &key)
 
- Public Member Functions inherited from Nektar::LibUtilities::H5::CanHaveAttributes
AttributeSharedPtr CreateAttribute (const std::string &name, DataTypeSharedPtr type, DataSpaceSharedPtr space)
 
AttributeSharedPtr OpenAttribute (const std::string &name)
 
template<class T >
void SetAttribute (const std::string &name, const T &value)
 
template<class T >
void SetAttribute (const std::string &name, const std::vector< T > &value)
 
template<class T >
void GetAttribute (const std::string &name, T &value)
 
template<class T >
void GetAttribute (const std::string &name, std::vector< T > &value)
 
int GetNumAttr () const
 
AttrIterator attr_begin ()
 
AttrIterator attr_end ()
 
- Public Member Functions inherited from Nektar::LibUtilities::H5::Object
void Close ()
 
hid_t GetId () const
 
 operator hid_t () const
 
- Public Member Functions inherited from Nektar::LibUtilities::H5::CanHaveGroupsDataSets
GroupSharedPtr CreateGroup (const std::string &name, PListSharedPtr createPL=PList::Default(), PListSharedPtr accessPL=PList::Default())
 
DataSetSharedPtr CreateDataSet (const std::string &name, DataTypeSharedPtr type, DataSpaceSharedPtr space, PListSharedPtr createPL=PList::Default(), PListSharedPtr accessPL=PList::Default())
 
template<class T >
DataSetSharedPtr CreateWriteDataSet (const std::string &name, const std::vector< T > &data, PListSharedPtr createPL=PList::Default(), PListSharedPtr accessPL=PList::Default())
 
GroupSharedPtr OpenGroup (const std::string &name, PListSharedPtr accessPL=PList::Default()) const
 
DataSetSharedPtr OpenDataSet (const std::string &name, PListSharedPtr accessPL=PList::Default()) const
 
bool ContainsDataSet (std::string nm)
 
hsize_t GetNumElements ()
 

Protected Member Functions

void v_Close () override
 
hsize_t v_GetNumElements () override
 
- Protected Member Functions inherited from Nektar::LibUtilities::H5::Object
 Object ()
 
 Object (hid_t id)
 
virtual ~Object ()
 
virtual void v_Close ()=0
 
- Protected Member Functions inherited from Nektar::LibUtilities::H5::CanHaveGroupsDataSets
virtual hsize_t v_GetNumElements ()=0
 
LinkIterator begin ()
 
LinkIterator end ()
 

Private Member Functions

 Group (hid_t id)
 

Friends

class CanHaveGroupsDataSets
 

Additional Inherited Members

- Protected Attributes inherited from Nektar::LibUtilities::H5::Object
hid_t m_Id
 

Detailed Description

HDF5 Group wrapper.

Definition at line 486 of file H5.h.

Constructor & Destructor Documentation

◆ ~Group()

Nektar::LibUtilities::H5::Group::~Group ( )
override

Definition at line 666 of file H5.cpp.

667{
668 if (m_Id != H5I_INVALID_HID)
669 {
670 Close();
671 }
672}

References Nektar::LibUtilities::H5::Object::Close(), and Nektar::LibUtilities::H5::Object::m_Id.

◆ Group()

Nektar::LibUtilities::H5::Group::Group ( hid_t  id)
private

Definition at line 662 of file H5.cpp.

662 : Object(id)
663{
664}

Member Function Documentation

◆ GetElementNames()

std::vector< std::string > Nektar::LibUtilities::H5::Group::GetElementNames ( )

Definition at line 687 of file H5.cpp.

688{
689 std::vector<std::string> ret;
690 for (int i = 0; i < GetNumElements(); i++)
691 {
692 char name[50];
693 H5Gget_objname_by_idx(m_Id, (size_t)i, name, 50);
694 ret.push_back(std::string(name));
695 }
696 return ret;
697}

References Nektar::LibUtilities::H5::CanHaveGroupsDataSets::GetNumElements(), Nektar::LibUtilities::H5::Object::m_Id, and CellMLToNektar.pycml::name.

◆ operator[]() [1/2]

CanHaveAttributesSharedPtr Nektar::LibUtilities::H5::Group::operator[] ( const std::string &  key)

◆ operator[]() [2/2]

CanHaveAttributesSharedPtr Nektar::LibUtilities::H5::Group::operator[] ( hsize_t  idx)

◆ v_Close()

void Nektar::LibUtilities::H5::Group::v_Close ( )
overrideprotectedvirtual

Implements Nektar::LibUtilities::H5::Object.

Definition at line 674 of file H5.cpp.

675{
676 H5_CALL(H5Gclose, (m_Id));
677 m_Id = H5I_INVALID_HID;
678}
#define H5_CALL(func, args)
Definition: H5.h:58

References H5_CALL, and Nektar::LibUtilities::H5::Object::m_Id.

◆ v_GetNumElements()

hsize_t Nektar::LibUtilities::H5::Group::v_GetNumElements ( )
overrideprotectedvirtual

Implements Nektar::LibUtilities::H5::CanHaveGroupsDataSets.

Definition at line 680 of file H5.cpp.

681{
682 H5G_info_t info;
683 H5_CALL(H5Gget_info, (m_Id, &info));
684 return info.nlinks;
685}

References H5_CALL, and Nektar::LibUtilities::H5::Object::m_Id.

Friends And Related Function Documentation

◆ CanHaveGroupsDataSets

friend class CanHaveGroupsDataSets
friend

Definition at line 500 of file H5.h.