Field3D
Hdf5Util::H5ScopedAopenIdx Class Reference

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

#include <Hdf5Util.h>

Inheritance diagram for Hdf5Util::H5ScopedAopenIdx:
Hdf5Util::H5Base

Public Member Functions

 H5ScopedAopenIdx (hid_t location, unsigned idx)
 ~H5ScopedAopenIdx ()
- 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 index and closes it on destruction.

Definition at line 129 of file Hdf5Util.h.

Constructor & Destructor Documentation

Hdf5Util::H5ScopedAopenIdx::H5ScopedAopenIdx ( hid_t  location,
unsigned  idx 
)
inline

Definition at line 132 of file Hdf5Util.h.

References Hdf5Util::H5Base::m_id.

{
m_id = H5Aopen_idx(location, idx);
if (m_id < 0)
throw Exc::MissingAttributeException("Couldn't open attribute at index: " +
boost::lexical_cast<std::string>(idx));
}
Hdf5Util::H5ScopedAopenIdx::~H5ScopedAopenIdx ( )
inline

Definition at line 139 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: