Field3D
Hdf5Util::H5ScopedAopen Class Reference

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

#include <Hdf5Util.h>

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

List of all members.

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.
 operator hid_t ()
 Implicit cast to hid_t.

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

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

Definition at line 106 of file Hdf5Util.h.

References Hdf5Util::H5Base::m_id.

{
m_id = H5Aopen(location, name.c_str(), H5P_DEFAULT);
if (m_id < 0)
throw Exc::MissingAttributeException("Couldn't open attribute " + name);
}
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.

{
m_id = H5Aopen(location, name.c_str(), aapl_id);
if (m_id < 0)
throw Exc::MissingAttributeException("Couldn't open attribute " + name);
}
Hdf5Util::H5ScopedAopen::~H5ScopedAopen ( )
inline

Definition at line 118 of file Hdf5Util.h.

References Hdf5Util::H5Base::m_id.

{
if (m_id >= 0)
H5Aclose(m_id);
}

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