An owning object handle that derives from unique_ptr that destroys an object using an ObjectDeallocator rather than std::default_delete when it goes out of scope.
More...
#include <bond/systems/allocator.h>
template<typename T>
class Bond::Allocator::ObjectHandle< T >
An owning object handle that derives from unique_ptr that destroys an object using an ObjectDeallocator rather than std::default_delete when it goes out of scope.
◆ ObjectHandle() [1/3]
Constructs an ObjectHandle object.
- Parameters
-
| allocator | The allocator that frees the memory, or null if the object is not to be destroyed. |
| ptr | Pointer to the owned object, whose memory must have been allocated by allocator. |
◆ ObjectHandle() [2/3]
Constructs an ObjectHandle object.
- Parameters
-
| allocator | The allocator that frees the memory. |
| ptr | Pointer to the owned object, whose memory must have been allocated by allocator. |
◆ ObjectHandle() [3/3]
Constructs an ObjectHandle object that takes ownership of the object owned by another.
◆ operator ObjectHandle< U >()
template<typename T>
template<typename U, typename Bond::enable_if< Bond::is_same< U, T >::value||Bond::has_virtual_destructor< U >::value, int >::type = 0>
Transfers ownership of the object to an ObjectHandle of another type, which must be T or have a virtual destructor so that the object is destroyed correctly.
◆ operator=()
Destroys the currently owned object and takes ownership of the object owned by another ObjectHandle.
The documentation for this class was generated from the following file:
- include/bond/systems/allocator.h