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 ()

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: