|
Rumba C++ SDK
|
Allocator to use with std::vector. Allocates memory first in the user provided buffer and then using the standard allocator. More...
#include <BufferAllocator.h>
Public Types | |
| using | size_type = typename std::allocator< T >::size_type |
| using | value_type = typename std::allocator< T >::value_type |
| using | difference_type = typename std::allocator< T >::difference_type |
| using | pointer = typename std::allocator< T >::pointer |
| using | const_pointer = typename std::allocator< T >::const_pointer |
| using | reference = typename std::allocator< T >::reference |
| using | const_reference = typename std::allocator< T >::const_reference |
| using | propagate_on_container_move_assignment = std::true_type |
Public Member Functions | |
| BufferAllocator ()=delete | |
| BufferAllocator (T *ptr, size_type size) | |
| Creates a BufferAllocator. More... | |
| T * | allocate (size_type n, const void *hint=0) |
| void | deallocate (T *p, std::size_t n) |
| bool | use_heap () const |
| Return true if the heap allocator has been used by this allocator. Return false if only the buffer has been used. More... | |
Allocator to use with std::vector. Allocates memory first in the user provided buffer and then using the standard allocator.
| using maquina::BufferAllocator< T >::const_pointer = typename std::allocator<T>::const_pointer |
| using maquina::BufferAllocator< T >::const_reference = typename std::allocator<T>::const_reference |
| using maquina::BufferAllocator< T >::difference_type = typename std::allocator<T>::difference_type |
| using maquina::BufferAllocator< T >::pointer = typename std::allocator<T>::pointer |
| using maquina::BufferAllocator< T >::propagate_on_container_move_assignment = std::true_type |
| using maquina::BufferAllocator< T >::reference = typename std::allocator<T>::reference |
| using maquina::BufferAllocator< T >::size_type = typename std::allocator<T>::size_type |
| using maquina::BufferAllocator< T >::value_type = typename std::allocator<T>::value_type |
|
delete |
|
inline |
Creates a BufferAllocator.
| ptr | A user provided buffer where the first allocation should be performed. |
| size | The user buffer size in number of objects. |
|
inline |
|
inline |
|
inline |
Return true if the heap allocator has been used by this allocator. Return false if only the buffer has been used.