Field3D

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. 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 index and closes it on destruction.

Definition at line 142 of file Hdf5Util.h.

Constructor & Destructor Documentation

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

Definition at line 145 of file Hdf5Util.h.

References g_hdf5Mutex, and Hdf5Util::H5Base::m_id.

146  {
147  GlobalLock lock(g_hdf5Mutex);
148  m_id = H5Aopen_idx(location, idx);
149  if (m_id < 0)
150  throw Exc::MissingAttributeException("Couldn't open attribute at index: " +
151  boost::lexical_cast<std::string>(idx));
152  }
boost::recursive_mutex::scoped_lock GlobalLock
Definition: Hdf5Util.h:78
FIELD3D_NAMESPACE_OPEN FIELD3D_API boost::recursive_mutex g_hdf5Mutex
Definition: Hdf5Util.cpp:67
Hdf5Util::H5ScopedAopenIdx::~H5ScopedAopenIdx ( )
inline

Definition at line 153 of file Hdf5Util.h.

References g_hdf5Mutex, and Hdf5Util::H5Base::m_id.

154  {
155  GlobalLock lock(g_hdf5Mutex);
156  if (m_id >= 0)
157  H5Aclose(m_id);
158  }
boost::recursive_mutex::scoped_lock GlobalLock
Definition: Hdf5Util.h:78
FIELD3D_NAMESPACE_OPEN FIELD3D_API boost::recursive_mutex g_hdf5Mutex
Definition: Hdf5Util.cpp:67

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