Utopia 2
Framework for studying models of complex & adaptive systems.
|
Wrapper class around an hdf5 identifier, used to manage reference counts of the object this identifier refers to. More...
#include <hdfidentifier.hh>
Public Member Functions | |
void | swap (HDFIdentifier &other) |
Exchange states between caller and 'other'. | |
hid_t | get_id () const |
Get the HDF5 id held by this object. | |
void | set_id (hid_t id) |
Set id to the given argument. Only to be used to invalidate objects upon move or similar. | |
bool | is_valid () const |
Check if thi ID refers to a valid object. | |
auto | get_refcount () const |
Get the number of references currently referring to the object identified by this ID. | |
void | increment_refcount () |
Increase the reference count of the object referred to by this ID by one. | |
void | decrement_refcount () |
Decrease the reference count of the object referred to by this ID by one. | |
void | close () |
Close the identifier and render the C-Level id held invalid. | |
void | open (hid_t id, std::function< herr_t(hid_t) > closing_func) |
Open the object and bind it to another C-Level id. | |
HDFIdentifier (hid_t id, std::function< herr_t(hid_t) > closing_func) | |
Construct HDFIdentifier from the given arguments. | |
HDFIdentifier () | |
Construct HDFIdentifier from the given arguments. | |
HDFIdentifier (const HDFIdentifier &other) | |
Construct HDFIdentifier by copying another instance of HDFIdentifier, incrementing the refcount of the held id in the process. | |
HDFIdentifier (HDFIdentifier &&other) | |
Construct HDFIdentifier by moving from another instance of HDFIdentifier. | |
HDFIdentifier & | operator= (const HDFIdentifier &other) |
Assign HDFIdentifier by copying another instance of HDFIdentifier, incrementing the refcount of the held id in the process. | |
HDFIdentifier & | operator= (HDFIdentifier &&other) |
Assign HDFIdentifier by moving from another instance of HDFIdentifier. | |
~HDFIdentifier () | |
Destroy the HDFIdentifier object, decrementing its refcount. | |
Private Attributes | |
hid_t | _id = -1 |
std::function< herr_t(hid_t) > | _closing_func |
Wrapper class around an hdf5 identifier, used to manage reference counts of the object this identifier refers to.
|
inline |
Construct HDFIdentifier from the given arguments.
id | C-Level id that is to be wrappend into an object of this class. Management of this id is then taken over by this class instance. Continuing to do so using the C-Interface outside of this class will result in errors. |
|
inline |
Construct HDFIdentifier from the given arguments.
|
inline |
Construct HDFIdentifier by copying another instance of HDFIdentifier, incrementing the refcount of the held id in the process.
other | Object to copy from |
|
inline |
Construct HDFIdentifier by moving from another instance of HDFIdentifier.
|
inline |
Destroy the HDFIdentifier object, decrementing its refcount.
|
inline |
Close the identifier and render the C-Level id held invalid.
|
inline |
Decrease the reference count of the object referred to by this ID by one.
|
inline |
|
inline |
Get the number of references currently referring to the object identified by this ID.
|
inline |
Increase the reference count of the object referred to by this ID by one.
|
inline |
Check if thi ID refers to a valid object.
|
inline |
Open the object and bind it to another C-Level id.
id |
|
inline |
Assign HDFIdentifier by copying another instance of HDFIdentifier, incrementing the refcount of the held id in the process.
other | Object to copy from |
|
inline |
Assign HDFIdentifier by moving from another instance of HDFIdentifier.
Set id to the given argument. Only to be used to invalidate objects upon move or similar.
id |
|
inline |
Exchange states between caller and 'other'.
other | Identifier to exchange states with |
|
private |