plugify 1.0.0.0
|
A generic handle class that manages a pointer to an object of type T. More...
#include <handle.hpp>
Public Member Functions | |
Handle () noexcept | |
Default constructor. Initializes the handle with a null pointer. | |
Handle (T &impl) noexcept | |
Constructs a Handle object from an instance of type T. | |
Handle (const Handle &)=default | |
Copy constructor. Creates a new Handle object from another Handle object. | |
Handle (Handle &&)=default | |
Move constructor. Transfers ownership from another Handle object. | |
auto | operator<=> (const Handle &) const =default |
Comparison operator (<=>) for comparing two Handle objects. | |
Handle & | operator= (const Handle &) &=default |
Copy assignment operator. Copies the handle from another Handle object. | |
Handle & | operator= (const Handle &) &&=delete |
Copy assignment operator for rvalue references is deleted. | |
Handle & | operator= (Handle &&) &=default |
Move assignment operator. Transfers ownership from another Handle object. | |
Handle & | operator= (Handle &&) &&=delete |
Move assignment operator for rvalue references is deleted. | |
operator bool () const noexcept | |
Explicit conversion operator to bool, indicating if the pointer is non-zero. | |
operator uintptr_t () const noexcept | |
Converts the Handle object to a uintptr_t. | |
operator void * () const noexcept | |
Converts the Handle object to a void pointer. | |
Protected Attributes | |
T * | _impl |
A pointer to the referenced implementation of type T. | |
A generic handle class that manages a pointer to an object of type T.
The Handle class provides a lightweight wrapper around a raw pointer, allowing safe access and management of resources. It can be null and provides comparison operators and conversion functions.
T | The type of the object being referenced. |
Definition at line 18 of file handle.hpp.
|
inlinenoexcept |
Default constructor. Initializes the handle with a null pointer.
Definition at line 23 of file handle.hpp.
|
inlinenoexcept |
Constructs a Handle object from an instance of type T.
impl | A reference to an object of type T to be wrapped. |
Definition at line 29 of file handle.hpp.
|
default |
|
default |
|
inlineexplicitnoexcept |
Explicit conversion operator to bool, indicating if the pointer is non-zero.
Definition at line 76 of file handle.hpp.
|
inlinenoexcept |
Converts the Handle object to a uintptr_t.
Definition at line 84 of file handle.hpp.
|
inlinenoexcept |
Converts the Handle object to a void pointer.
Definition at line 92 of file handle.hpp.
|
default |
|
delete |
Copy assignment operator for rvalue references is deleted.
other | The Handle object to copy from. |
|
default |
|
delete |
Move assignment operator for rvalue references is deleted.
other | The Handle object to move from. |
|
default |
|
protected |
A pointer to the referenced implementation of type T.
Definition at line 97 of file handle.hpp.