Nektar++
Public 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 ()
 
void Close ()
 
DataSpaceSharedPtr GetSpace () const
 
- Public Member Functions inherited from Nektar::LibUtilities::H5::Object
hid_t GetId () const
 
 operator hid_t () const
 

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 Member Functions inherited from Nektar::LibUtilities::H5::Object
 Object ()
 
 Object (hid_t id)
 
virtual ~Object ()
 
- 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 ( )

Definition at line 614 of file H5.cpp.

615 {
616  Close();
617 }

References Close().

◆ Attribute()

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

Definition at line 454 of file H5.h.

454  : Object(id)
455  {
456  }

Referenced by Create(), and Open().

Member Function Documentation

◆ Close()

void Nektar::LibUtilities::H5::Attribute::Close ( )
virtual

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

Definition at line 618 of file H5.cpp.

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

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

Referenced by ~Attribute().

◆ 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, (parent, name.c_str(), type->GetId(),
603  space->GetId(), H5P_DEFAULT, H5P_DEFAULT));
604  return AttributeSharedPtr(new Attribute(id));
605 }
#define H5_CONSTRUCT(ans, func, args)
Definition: H5.h:56
std::shared_ptr< Attribute > AttributeSharedPtr
Definition: H5.h:94

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

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

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

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

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

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

Friends And Related Function Documentation

◆ CanHaveAttributes

friend class CanHaveAttributes
friend

Definition at line 462 of file H5.h.