Field3D

Scoped object - Opens attribute by name and closes it on destruction. More...

#include <Hdf5Util.h>

Inheritance diagram for Hdf5Util::H5ScopedAopen:
Hdf5Util::H5Base

Public Member Functions

 H5ScopedAopen (hid_t location, const std::string &name)
 
 H5ScopedAopen (hid_t location, const std::string &name, hid_t aapl_id)
 
 ~H5ScopedAopen ()
 
- Public Member Functions inherited from Hdf5Util::H5Base
 H5Base ()
 
hid_t id () const
 Query the hid_t value. More...
 
 operator hid_t ()
 Implicit cast to hid_t. More...
 

Additional Inherited Members

- Protected Attributes inherited from Hdf5Util::H5Base
hid_t m_id
 

Detailed Description

Scoped object - Opens attribute by name and closes it on destruction.

Definition at line 103 of file Hdf5Util.h.

Constructor & Destructor Documentation

◆ H5ScopedAopen() [1/2]

Hdf5Util::H5ScopedAopen::H5ScopedAopen ( hid_t  location,
const std::string &  name 
)
inline

Definition at line 106 of file Hdf5Util.h.

References Hdf5Util::H5Base::m_id.

107  {
108  m_id = H5Aopen(location, name.c_str(), H5P_DEFAULT);
109  if (m_id < 0)
110  throw Exc::MissingAttributeException("Couldn't open attribute " + name);
111  }

◆ H5ScopedAopen() [2/2]

Hdf5Util::H5ScopedAopen::H5ScopedAopen ( hid_t  location,
const std::string &  name,
hid_t  aapl_id 
)
inline

Definition at line 112 of file Hdf5Util.h.

References Hdf5Util::H5Base::m_id.

113  {
114  m_id = H5Aopen(location, name.c_str(), aapl_id);
115  if (m_id < 0)
116  throw Exc::MissingAttributeException("Couldn't open attribute " + name);
117  }

◆ ~H5ScopedAopen()

Hdf5Util::H5ScopedAopen::~H5ScopedAopen ( )
inline

Definition at line 118 of file Hdf5Util.h.

References Hdf5Util::H5Base::m_id.

119  {
120  if (m_id >= 0)
121  H5Aclose(m_id);
122  }

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