Bond 0.9
C++ Bond Runtime Library API Documentation
Loading...
Searching...
No Matches
Bond::Allocator::AlignedObjectHandle< T > Class Template Reference

An owning object handle that derives from unique_ptr that destroys an aligned object using an AlignedObjectDeallocator rather than std::default_delete when it goes out of scope. More...

#include <bond/systems/allocator.h>

Inheritance diagram for Bond::Allocator::AlignedObjectHandle< T >:

Public Member Functions

 AlignedObjectHandle (Allocator *allocator=nullptr, T *ptr=nullptr)
 Constructs an AlignedObjectHandle object.
 AlignedObjectHandle (Allocator &allocator, T *ptr=nullptr)
 Constructs an AlignedObjectHandle object.
 AlignedObjectHandle (AlignedObjectHandle &&other)
 Constructs an AlignedObjectHandle object that takes ownership of the object owned by another.
AlignedObjectHandle & operator= (AlignedObjectHandle &&other)
 Destroys the currently owned object and takes ownership of the object owned by another AlignedObjectHandle.
template<typename U, typename Bond::enable_if< Bond::is_same< U, T >::value||Bond::has_virtual_destructor< U >::value, int >::type = 0>
 operator AlignedObjectHandle< U > () &&
 Transfers ownership of the object to an AlignedObjectHandle of another type, which must be T or have a virtual destructor so that the object is destroyed correctly.

Detailed Description

template<typename T>
class Bond::Allocator::AlignedObjectHandle< T >

An owning object handle that derives from unique_ptr that destroys an aligned object using an AlignedObjectDeallocator rather than std::default_delete when it goes out of scope.

Constructor & Destructor Documentation

◆ AlignedObjectHandle() [1/3]

template<typename T>
Bond::Allocator::AlignedObjectHandle< T >::AlignedObjectHandle ( Allocator * allocator = nullptr,
T * ptr = nullptr )
inline

Constructs an AlignedObjectHandle object.

Parameters
allocatorThe allocator that frees the memory, or null if the object is not to be destroyed.
ptrPointer to the owned object, whose memory must have been allocated by allocator with AllocateAligned.

◆ AlignedObjectHandle() [2/3]

template<typename T>
Bond::Allocator::AlignedObjectHandle< T >::AlignedObjectHandle ( Allocator & allocator,
T * ptr = nullptr )
inline

Constructs an AlignedObjectHandle object.

Parameters
allocatorThe allocator that frees the memory.
ptrPointer to the owned object, whose memory must have been allocated by allocator with AllocateAligned.

◆ AlignedObjectHandle() [3/3]

template<typename T>
Bond::Allocator::AlignedObjectHandle< T >::AlignedObjectHandle ( AlignedObjectHandle< T > && other)
inline

Constructs an AlignedObjectHandle object that takes ownership of the object owned by another.

Member Function Documentation

◆ operator AlignedObjectHandle< 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>
Bond::Allocator::AlignedObjectHandle< T >::operator AlignedObjectHandle< U > ( ) &&
inline

Transfers ownership of the object to an AlignedObjectHandle of another type, which must be T or have a virtual destructor so that the object is destroyed correctly.

◆ operator=()

template<typename T>
AlignedObjectHandle & Bond::Allocator::AlignedObjectHandle< T >::operator= ( AlignedObjectHandle< T > && other)
inline

Destroys the currently owned object and takes ownership of the object owned by another AlignedObjectHandle.


The documentation for this class was generated from the following file:
  • include/bond/systems/allocator.h