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

An owning memory handle that derives from unique_ptr that deallocates memory using an AlignedDeallocator rather than std::default_delete when it goes out of scope. More...

#include <bond/systems/allocator.h>

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

Public Member Functions

 AlignedHandle (Allocator *allocator=nullptr, T *ptr=nullptr)
 Constructs an AlignedHandle object.
 AlignedHandle (Allocator &allocator, T *ptr=nullptr)
 Constructs an AlignedHandle object.
 AlignedHandle (AlignedHandle &&other)
 Constructs an AlignedHandle object that takes ownership of the memory owned by another.
AlignedHandle & operator= (AlignedHandle &&other)
 Frees the currently owned memory and takes ownership of the memory owned by another AlignedHandle.
template<typename U>
 operator AlignedHandle< U > () &&
 Transfers ownership of the memory to an AlignedHandle of another pointer type.

Detailed Description

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

An owning memory handle that derives from unique_ptr that deallocates memory using an AlignedDeallocator rather than std::default_delete when it goes out of scope.

Constructor & Destructor Documentation

◆ AlignedHandle() [1/3]

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

Constructs an AlignedHandle object.

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

◆ AlignedHandle() [2/3]

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

Constructs an AlignedHandle object.

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

◆ AlignedHandle() [3/3]

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

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

Member Function Documentation

◆ operator AlignedHandle< U >()

template<typename T>
template<typename U>
Bond::Allocator::AlignedHandle< T >::operator AlignedHandle< U > ( ) &&
inline

Transfers ownership of the memory to an AlignedHandle of another pointer type.

◆ operator=()

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

Frees the currently owned memory and takes ownership of the memory owned by another AlignedHandle.


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