|
Mantid
|
A wrapper class for managing HDF5 object handles (hid_t). More...
#include <UniqueID.h>
Public Member Functions | |
| hid_t | get () const |
| Return the managed HDF5 handle. | |
| bool | isValid () const |
| Return whether the UniqueId corresponds to a valid HDF5 object. | |
| operator hid_t () const | |
| bool | operator< (int const id) const |
| bool | operator<= (int const id) const |
| UniqueID< D > & | operator= (hid_t const id) |
| Assign a HDF5 object ID to be managed. | |
| UniqueID< D > & | operator= (UniqueID< D > &&uid) |
| Pass the HDF5 object ID from an existing UniqueID to another UniqueID. | |
| bool | operator== (int const id) const |
| hid_t | release () |
| Release hold on the managed ID; it will not be closed by this UniqueID. | |
| void | reset (hid_t const id=INVALID_ID) |
| Close the existing ID and replace with the new ID; or, set to invalid. | |
| UniqueID () | |
| UniqueID (hid_t const id) | |
| UniqueID (UniqueID< D > &&uid) noexcept | |
| ~UniqueID () | |
Static Public Attributes | |
| static hid_t constexpr | INVALID_ID {-1} |
| represents an invalid ID value | |
Protected Attributes | |
| hid_t | m_id |
Private Member Functions | |
| void | close () |
| Close the held ID by calling its deleter function. | |
| void | close () |
| Close a ID corresponding to a file; and call garbage collection. | |
| UniqueID & | operator= (UniqueID< D > const &)=delete |
| UniqueID (UniqueID< D > const &uid)=delete | |
A wrapper class for managing HDF5 object handles (hid_t).
The UniqueID class is designed to manage the lifecycle of HDF5 object handles (hid_t), ensuring that the handle is properly closed when the UniqueID object is destroyed. This helps prevent resource leaks and ensures proper cleanup of HDF5 resources.
Definition at line 29 of file UniqueID.h.
|
privatedelete |
|
inline |
Definition at line 40 of file UniqueID.h.
|
inline |
Definition at line 41 of file UniqueID.h.
|
inline |
Definition at line 42 of file UniqueID.h.
References Mantid::Nexus::UniqueID< D >::close().
|
inlinenoexcept |
Definition at line 43 of file UniqueID.h.
References Mantid::Nexus::UniqueID< D >::INVALID_ID.
|
inlineprivate |
Close the held ID by calling its deleter function.
| deleter |
Definition at line 82 of file UniqueID.h.
Referenced by Mantid::Nexus::UniqueID< D >::~UniqueID().
|
inlineprivate |
Close a ID corresponding to a file; and call garbage collection.
Definition at line 90 of file UniqueID.h.
References H5Fclose(), and H5garbage_collect().
|
inline |
Return the managed HDF5 handle.
Definition at line 59 of file UniqueID.h.
References Mantid::Nexus::UniqueID< D >::m_id.
|
inline |
Return whether the UniqueId corresponds to a valid HDF5 object.
Definition at line 71 of file UniqueID.h.
References H5Iis_valid().
|
inline |
Definition at line 55 of file UniqueID.h.
References Mantid::Nexus::UniqueID< D >::m_id.
|
inline |
Definition at line 52 of file UniqueID.h.
References Mantid::Nexus::UniqueID< D >::m_id.
|
inline |
Definition at line 51 of file UniqueID.h.
References Mantid::Nexus::UniqueID< D >::m_id.
|
inline |
Assign a HDF5 object ID to be managed.
| id | : the ID to be managed |
Definition at line 118 of file UniqueID.h.
|
inline |
Pass the HDF5 object ID from an existing UniqueID to another UniqueID.
| uid | : the UniqueID previously managing the ID; it will lose ownership of the ID. |
Definition at line 125 of file UniqueID.h.
|
privatedelete |
|
inline |
Definition at line 50 of file UniqueID.h.
References Mantid::Nexus::UniqueID< D >::m_id.
|
inline |
Release hold on the managed ID; it will not be closed by this UniqueID.
Definition at line 101 of file UniqueID.h.
References tmp.
|
inline |
Close the existing ID and replace with the new ID; or, set to invalid.
| id | The new ID to be held; defaults to invalid |
Definition at line 109 of file UniqueID.h.
Referenced by Mantid::Nexus::H5Util::copyGroup(), and Mantid::Nexus::H5Util::isHdf5().
|
staticconstexpr |
represents an invalid ID value
Definition at line 66 of file UniqueID.h.
Referenced by Mantid::Nexus::UniqueID< D >::UniqueID().
|
protected |
Definition at line 31 of file UniqueID.h.
Referenced by Mantid::Nexus::UniqueID< D >::get(), Mantid::Nexus::UniqueID< D >::operator hid_t(), Mantid::Nexus::UniqueID< D >::operator<(), Mantid::Nexus::UniqueID< D >::operator<=(), and Mantid::Nexus::UniqueID< D >::operator==().