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 ()
 
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

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

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 452 of file H5.h.

Constructor & Destructor Documentation

◆ ~Attribute()

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

Definition at line 615 of file H5.cpp.

616 {
617  Close();
618 }

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

◆ Attribute()

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

Definition at line 462 of file H5.h.

462  : Object(id)
463  {
464  }

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 597 of file H5.cpp.

600 {
601  hid_t id;
602  H5_CONSTRUCT(id, H5Acreate2,
603  (parent, name.c_str(), type->GetId(), space->GetId(),
604  H5P_DEFAULT, H5P_DEFAULT));
605  return AttributeSharedPtr(new Attribute(id));
606 }
#define H5_CONSTRUCT(ans, func, args)
Definition: H5.h:56
std::shared_ptr< Attribute > AttributeSharedPtr
Definition: H5.h:87

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 625 of file H5.cpp.

626 {
627  return DataSpaceSharedPtr(new DataSpace(H5Aget_space(m_Id)));
628 }
std::shared_ptr< DataSpace > DataSpaceSharedPtr
Definition: H5.h:83

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 608 of file H5.cpp.

609 {
610  hid_t id;
611  H5_CONSTRUCT(id, H5Aopen, (parent, name.c_str(), H5P_DEFAULT));
612  return AttributeSharedPtr(new Attribute(id));
613 }

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 619 of file H5.cpp.

620 {
621  H5_CALL(H5Aclose, (m_Id));
622  m_Id = H5I_INVALID_HID;
623 }
#define H5_CALL(func, args)
Definition: H5.h:64

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

Friends And Related Function Documentation

◆ CanHaveAttributes

friend class CanHaveAttributes
friend

Definition at line 469 of file H5.h.