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

HDF5 Attribute Wrapper. More...

#include <H5.h>

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

Public Member Functions

 ~Attribute () override
 
DataSpaceSharedPtr GetSpace () const
 
- Public Member Functions inherited from Nektar::LibUtilities::H5::Object
void Close ()
 
hid_t GetId () const
 
 operator hid_t () const
 

Protected Member Functions

void v_Close () override
 
- Protected Member Functions inherited from Nektar::LibUtilities::H5::Object
 Object ()
 
 Object (hid_t id)
 
virtual ~Object ()
 
virtual void v_Close ()=0
 

Private Member Functions

 Attribute (hid_t id)
 

Static Private Member Functions

static AttributeSharedPtr Create (hid_t parent, const std::string &name, DataTypeSharedPtr type, DataSpaceSharedPtr space)
 
static AttributeSharedPtr Open (hid_t parent, const std::string &name)
 

Friends

class CanHaveAttributes
 

Additional Inherited Members

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

Detailed Description

HDF5 Attribute Wrapper.

Definition at line 446 of file H5.h.

Constructor & Destructor Documentation

◆ ~Attribute()

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

Definition at line 609 of file H5.cpp.

610{
611 Close();
612}

References Nektar::LibUtilities::H5::Object::Close().

◆ Attribute()

Nektar::LibUtilities::H5::Attribute::Attribute ( hid_t  id)
inlineprivate

Definition at line 456 of file H5.h.

456 : Object(id)
457 {
458 }

Referenced by Create(), and Open().

Member Function Documentation

◆ Create()

AttributeSharedPtr Nektar::LibUtilities::H5::Attribute::Create ( hid_t  parent,
const std::string &  name,
DataTypeSharedPtr  type,
DataSpaceSharedPtr  space 
)
staticprivate

Definition at line 591 of file H5.cpp.

594{
595 hid_t id;
596 H5_CONSTRUCT(id, H5Acreate2,
597 (parent, name.c_str(), type->GetId(), space->GetId(),
598 H5P_DEFAULT, H5P_DEFAULT));
599 return AttributeSharedPtr(new Attribute(id));
600}
#define H5_CONSTRUCT(ans, func, args)
Definition: H5.h:50
std::shared_ptr< Attribute > AttributeSharedPtr
Definition: H5.h:82

References Attribute(), H5_CONSTRUCT, and CellMLToNektar.pycml::name.

Referenced by Nektar::LibUtilities::H5::CanHaveAttributes::CreateAttribute().

◆ GetSpace()

DataSpaceSharedPtr Nektar::LibUtilities::H5::Attribute::GetSpace ( ) const

Definition at line 619 of file H5.cpp.

620{
621 return DataSpaceSharedPtr(new DataSpace(H5Aget_space(m_Id)));
622}
std::shared_ptr< DataSpace > DataSpaceSharedPtr
Definition: H5.h:78

References Nektar::LibUtilities::H5::Object::m_Id.

◆ Open()

AttributeSharedPtr Nektar::LibUtilities::H5::Attribute::Open ( hid_t  parent,
const std::string &  name 
)
staticprivate

Definition at line 602 of file H5.cpp.

603{
604 hid_t id;
605 H5_CONSTRUCT(id, H5Aopen, (parent, name.c_str(), H5P_DEFAULT));
606 return AttributeSharedPtr(new Attribute(id));
607}

References Attribute(), H5_CONSTRUCT, and CellMLToNektar.pycml::name.

Referenced by Nektar::LibUtilities::H5::CanHaveAttributes::OpenAttribute().

◆ v_Close()

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

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

Definition at line 613 of file H5.cpp.

614{
615 H5_CALL(H5Aclose, (m_Id));
616 m_Id = H5I_INVALID_HID;
617}
#define H5_CALL(func, args)
Definition: H5.h:58

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

Friends And Related Function Documentation

◆ CanHaveAttributes

friend class CanHaveAttributes
friend

Definition at line 463 of file H5.h.