Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | List of all members
Mantid::Nexus::UniqueID< D > Class Template Reference

A wrapper class for managing HDF5 object handles (hid_t). More...

#include <UniqueID.h>

Inheritance diagram for Mantid::Nexus::UniqueID< D >:
Mantid::Nexus::Hdf5ID< D >

Public Member Functions

UniqueID< D > & operator= (hid_t const)
 Assign a HDF5 object ID to be managed.
 
UniqueID< D > & operator= (UniqueID< D > &&)
 Pass the HDF5 object ID from an existing UniqueID to another UniqueID.
 
hid_t release ()
 Release hold on the managed ID; it will not be closed by this UniqueID.
 
void reset ()
 
void reset (hid_t const)
 Close the existing ID and replace with the new ID; or, set to invalid.
 
void reset (UniqueID< D > &&)
 Close the existing ID and replace with the new ID; or, set to invalid.
 
void reset (UniqueID< D > const &)=delete
 
 UniqueID ()
 
 UniqueID (hid_t const id)
 
 UniqueID (UniqueID< D > &&uid) noexcept
 
 ~UniqueID ()
 
- 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

UniqueIDoperator= (UniqueID< D > const &)=delete
 
 UniqueID (UniqueID< D > const &)=delete
 

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
 

Detailed Description

template<herr_t(*)(hid_t) D>
class Mantid::Nexus::UniqueID< D >

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 92 of file UniqueID.h.

Constructor & Destructor Documentation

◆ UniqueID() [1/4]

template<herr_t(*)(hid_t) D>
Mantid::Nexus::UniqueID< D >::UniqueID ( UniqueID< D > const &  )
privatedelete

◆ UniqueID() [2/4]

template<herr_t(*)(hid_t) D>
Mantid::Nexus::UniqueID< D >::UniqueID ( )
inline

Definition at line 100 of file UniqueID.h.

◆ UniqueID() [3/4]

template<herr_t(*)(hid_t) D>
Mantid::Nexus::UniqueID< D >::UniqueID ( hid_t const  id)
inline

Definition at line 101 of file UniqueID.h.

◆ UniqueID() [4/4]

template<herr_t(*)(hid_t) D>
Mantid::Nexus::UniqueID< D >::UniqueID ( UniqueID< D > &&  uid)
inlinenoexcept

Definition at line 102 of file UniqueID.h.

References Mantid::Nexus::INVALID_HID, and Mantid::Nexus::Hdf5ID< D >::m_id.

◆ ~UniqueID()

template<herr_t(*)(hid_t) D>
Mantid::Nexus::UniqueID< D >::~UniqueID ( )
inline

Definition at line 103 of file UniqueID.h.

References Mantid::Nexus::Hdf5ID< D >::close().

Member Function Documentation

◆ operator=() [1/3]

template<herr_t(*)(hid_t) D>
UniqueID< D > & Mantid::Nexus::UniqueID< D >::operator= ( hid_t const  id)
inline

Assign a HDF5 object ID to be managed.

Parameters
id: the ID to be managed

Definition at line 144 of file UniqueID.h.

◆ operator=() [2/3]

template<herr_t(*)(hid_t) D>
UniqueID< D > & Mantid::Nexus::UniqueID< D >::operator= ( UniqueID< D > &&  uid)
inline

Pass the HDF5 object ID from an existing UniqueID to another UniqueID.

Parameters
uid: the UniqueID previously managing the ID; it will lose ownership of the ID.

Definition at line 151 of file UniqueID.h.

◆ operator=() [3/3]

template<herr_t(*)(hid_t) D>
UniqueID & Mantid::Nexus::UniqueID< D >::operator= ( UniqueID< D > const &  )
privatedelete

◆ release()

template<herr_t(*)(hid_t) D>
hid_t Mantid::Nexus::UniqueID< D >::release ( )
inline

Release hold on the managed ID; it will not be closed by this UniqueID.

Returns
the managed ID

Definition at line 118 of file UniqueID.h.

References Mantid::Nexus::INVALID_HID, and tmp.

◆ reset() [1/4]

template<herr_t(*)(hid_t) D>
void Mantid::Nexus::UniqueID< D >::reset ( )
inline

◆ reset() [2/4]

template<herr_t(*)(hid_t) D>
void Mantid::Nexus::UniqueID< D >::reset ( hid_t const  id)
inline

Close the existing ID and replace with the new ID; or, set to invalid.

Parameters
idThe new ID to be held; defaults to invalid

Definition at line 126 of file UniqueID.h.

◆ reset() [3/4]

template<herr_t(*)(hid_t) D>
void Mantid::Nexus::UniqueID< D >::reset ( UniqueID< D > &&  uid)
inline

Close the existing ID and replace with the new ID; or, set to invalid.

Parameters
uida UniqueID being moved and releasing control to this UniqueID

Definition at line 135 of file UniqueID.h.

References Mantid::Nexus::INVALID_HID.

◆ reset() [4/4]

template<herr_t(*)(hid_t) D>
void Mantid::Nexus::UniqueID< D >::reset ( UniqueID< D > const &  )
delete

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