DART 6.13.2
|
Wrapper class for MemoryAllocator to be compatible with std::allocator. More...
#include <StlAllocator.hpp>
Classes | |
struct | rebind |
Public Types | |
using | Base = std::allocator< T > |
using | value_type = typename std::allocator_traits< Base >::value_type |
using | size_type = typename std::allocator_traits< Base >::size_type |
using | pointer = typename std::allocator_traits< Base >::pointer |
using | const_pointer = typename std::allocator_traits< Base >::const_pointer |
Public Member Functions | |
StlAllocator (MemoryAllocator &baseAllocator=MemoryAllocator::GetDefault()) noexcept | |
Default constructor. | |
StlAllocator (const StlAllocator &other) throw () | |
Copy constructor. | |
template<class U > | |
StlAllocator (const StlAllocator< U > &other) throw () | |
Copy constructor. | |
~StlAllocator ()=default | |
Destructor. | |
pointer | allocate (size_type n, const void *hint=0) |
Allocates n * sizeof(T) bytes of uninitialized storage. | |
void | deallocate (pointer pointer, size_type n) |
Deallocates the storage referenced by the pointer p , which must be a pointer obtained by an earlier cal to allocate(). | |
void | print (std::ostream &os=std::cout, int indent=0) const |
Prints state of the memory allocator. | |
Private Attributes | |
MemoryAllocator & | mBaseAllocator |
Friends | |
template<typename U > | |
class | StlAllocator |
template<typename U > | |
std::ostream & | operator<< (std::ostream &os, const StlAllocator< U > &allocator) |
Prints state of the memory allocator. | |
Wrapper class for MemoryAllocator to be compatible with std::allocator.
using dart::common::StlAllocator< T >::Base = std::allocator<T> |
using dart::common::StlAllocator< T >::const_pointer = typename std::allocator_traits<Base>::const_pointer |
using dart::common::StlAllocator< T >::pointer = typename std::allocator_traits<Base>::pointer |
using dart::common::StlAllocator< T >::size_type = typename std::allocator_traits<Base>::size_type |
using dart::common::StlAllocator< T >::value_type = typename std::allocator_traits<Base>::value_type |
|
explicitnoexcept |
Default constructor.
dart::common::StlAllocator< T >::StlAllocator | ( | const StlAllocator< T > & | other | ) | |
throw | ( | ||||
) |
Copy constructor.
dart::common::StlAllocator< T >::StlAllocator | ( | const StlAllocator< U > & | other | ) | |
throw | ( | ||||
) |
Copy constructor.
|
default |
Destructor.
StlAllocator< T >::pointer dart::common::StlAllocator< T >::allocate | ( | size_type | n, |
const void * | hint = 0 |
||
) |
Allocates n * sizeof(T) bytes of uninitialized storage.
[in] | n | The number of objects to allocate sotrage for. |
[in] | hint | Point to a nearby memory location. |
void dart::common::StlAllocator< T >::deallocate | ( | pointer | pointer, |
size_type | n | ||
) |
Deallocates the storage referenced by the pointer p
, which must be a pointer obtained by an earlier cal to allocate().
[in] | pointer | Pointer obtained from allocate(). |
[in] | n | Number of objects earlier passed to allocate(). |
void dart::common::StlAllocator< T >::print | ( | std::ostream & | os = std::cout , |
int | indent = 0 |
||
) | const |
Prints state of the memory allocator.
|
friend |
Prints state of the memory allocator.
|
private |