|
Mantid
|
A wrapper class for managing HDF5 object handles (hid_t) that can be shared. More...
#include <UniqueID.h>
Public Member Functions | |
| SharedID< D > & | operator= (hid_t const) |
| SharedID< D > & | operator= (SharedID< D > &&) |
| SharedID< D > & | operator= (SharedID< D > const &) |
| bool | operator== (SharedID< D > const &uid) const |
| ensure two SharedIDs are tracking the same object | |
| void | reset () |
| void | reset (hid_t const) |
| Decrement the existing ID and replace with the new ID; or, set to invalid. | |
| void | reset (SharedID< D > &&) |
| Decrement the existing ID and replace with the new ID; or, set to invalid. | |
| void | reset (SharedID< D > const &) |
| Decrement the existing ID and replace with the new ID; or, set to invalid. | |
| SharedID () | |
| SharedID (hid_t id) | |
| SharedID (SharedID< D > &&uid) | |
| SharedID (SharedID< D > const &uid) | |
| std::size_t | use_count () const |
| Returns the number of SharedID objects holding the same ID. | |
| ~SharedID () | |
Public Member Functions inherited from Mantid::Nexus::Hdf5ID< D > | |
| hid_t | get () const |
| Return the managed HDF5 handle. | |
| Hdf5ID () noexcept | |
| Hdf5ID (hid_t const id) noexcept | |
| bool | isValid () const |
| Return whether the UniqueId corresponds to a valid HDF5 object. | |
| operator hid_t () const | |
| bool | operator!= (hid_t const id) const |
| bool | operator< (hid_t const id) const |
| bool | operator<= (hid_t const id) const |
| bool | operator== (hid_t const id) const |
Private Member Functions | |
| void | decrement_leash_counts () |
| void | increment_leash_counts () |
Private Attributes | |
| std::atomic< std::size_t > * | m_leash_counts |
Additional Inherited Members | |
Protected Member Functions inherited from Mantid::Nexus::Hdf5ID< D > | |
| void | close () |
| Close the held object ID. | |
| void | close () |
| Close a held file ID, and also call garbage collection. | |
Protected Attributes inherited from Mantid::Nexus::Hdf5ID< D > | |
| hid_t | m_id |
A wrapper class for managing HDF5 object handles (hid_t) that can be shared.
The SharedID class is designed to manage the lifecycle of HDF5 object handles (hid_t), with multiple ownership, ensuring the handle is properly closed when all leashes to it are dropped. This helps prevent resource leaks and ensures proper cleanup of HDF5 resources.
Definition at line 167 of file UniqueID.h.
|
inline |
Definition at line 175 of file UniqueID.h.
|
inline |
Definition at line 176 of file UniqueID.h.
|
inline |
Definition at line 177 of file UniqueID.h.
References Mantid::Nexus::SharedID< D >::increment_leash_counts().
|
inline |
Definition at line 180 of file UniqueID.h.
References Mantid::Nexus::INVALID_HID, and Mantid::Nexus::Hdf5ID< D >::m_id.
|
inline |
Definition at line 184 of file UniqueID.h.
References Mantid::Nexus::SharedID< D >::decrement_leash_counts().
|
inlineprivate |
Definition at line 254 of file UniqueID.h.
Referenced by Mantid::Nexus::SharedID< D >::~SharedID().
|
inlineprivate |
Definition at line 244 of file UniqueID.h.
Referenced by Mantid::Nexus::SharedID< D >::SharedID().
|
inline |
Definition at line 270 of file UniqueID.h.
|
inline |
Definition at line 280 of file UniqueID.h.
|
inline |
Definition at line 275 of file UniqueID.h.
|
inline |
ensure two SharedIDs are tracking the same object
Definition at line 191 of file UniqueID.h.
References Mantid::Nexus::Hdf5ID< D >::m_id, and Mantid::Nexus::SharedID< D >::m_leash_counts.
|
inline |
Definition at line 202 of file UniqueID.h.
References Mantid::Nexus::INVALID_HID, and Mantid::Nexus::SharedID< D >::reset().
Referenced by Mantid::Nexus::SharedID< D >::reset().
|
inline |
Decrement 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 210 of file UniqueID.h.
|
inline |
Decrement the existing ID and replace with the new ID; or, set to invalid.
| uid | A SharedID whose ID will be moved to here |
Definition at line 232 of file UniqueID.h.
References Mantid::Nexus::INVALID_HID.
|
inline |
Decrement the existing ID and replace with the new ID; or, set to invalid.
| uid | A SharedID whose ID will be shared |
Definition at line 221 of file UniqueID.h.
References Mantid::Nexus::Hdf5ID< D >::m_id, and Mantid::Nexus::SharedID< D >::m_leash_counts.
|
inline |
Returns the number of SharedID objects holding the same ID.
Definition at line 200 of file UniqueID.h.
References Mantid::Nexus::SharedID< D >::m_leash_counts.
|
private |
Definition at line 169 of file UniqueID.h.
Referenced by Mantid::Nexus::SharedID< D >::operator==(), Mantid::Nexus::SharedID< D >::reset(), and Mantid::Nexus::SharedID< D >::use_count().