template<typename T, class AllocT = allocator<T>>
struct fennec::allocation< T, AllocT >
- Template Parameters
-
| T | The data type of the allocation |
This simply acts as a proxy for allocating memory. It does not call any constructors or initialize any values as if they were the provided data type. Any operations present work only on individual bytes.
|
|
constexpr | allocation () noexcept |
| | Default Constructor, initializes internal data to null and the capacity to 0
|
| |
| constexpr | allocation (size_t n) noexcept |
| | Sized Constructor, initializes the allocation with a block of size n * sizeof(T) bytes.
|
| |
| constexpr | allocation (const T *data, size_t n) |
| | Buffer Copy Constructor, initializes the allocation with a block of size n * sizeof(T) bytes. Then, the contents of data are byte copied into the allocation.
|
| |
| constexpr | allocation (size_t n, align_t align) noexcept |
| | Sized Constructor, initializes the allocation with a block of size n * sizeof(T) bytes.
|
| |
| constexpr | allocation (const T *data, size_t n, align_t align) |
| | Buffer Copy Constructor, initializes the allocation with a block of size n * sizeof(T) bytes. Then, the contents of data are byte copied into the allocation.
|
| |
| constexpr | allocation (const alloc_t &alloc) noexcept |
| | Allocator Constructor.
|
| |
| constexpr | allocation (size_t n, const alloc_t &alloc) noexcept |
| | Sized Allocator Constructor.
|
| |
| constexpr | allocation (const T *data, size_t n, const alloc_t &alloc) |
| | Buffer Copy Allocator Constructor, initializes the allocation with a block of size n * sizeof(T) bytes. Then, the contents of data are copied into the allocation.
|
| |
| constexpr | allocation (size_t n, align_t align, const alloc_t &alloc) noexcept |
| | Sized Allocator Constructor.
|
| |
| constexpr | allocation (const T *data, size_t n, align_t align, const alloc_t &alloc) |
| | Buffer Copy Allocator Constructor, initializes the allocation with a block of size n * sizeof(T) bytes. Then, the contents of data are copied into the allocation.
|
| |
| constexpr | allocation (const allocation &alloc) noexcept |
| | Copy Constructor, creates an allocation of equal size and performs a byte-wise copy.
|
| |
| constexpr | allocation (allocation &&alloc) noexcept |
| | Move Constructor, moves the data in alloc to the new object and cleans alloc so that it can safely destruct.
|
| |
|
constexpr | ~allocation () noexcept |
| | Default Destructor, releases the memory block if still present.
|
| |
| constexpr allocation & | operator= (const allocation &alloc) |
| | Copy Assignment Operator.
|
| |
| constexpr allocation & | operator= (allocation &&alloc) noexcept |
| | Move Assignment Operator.
|
| |
| constexpr void | allocate (size_t n, align_t align=zero< align_t >()) noexcept |
| | Allocate a block of memory for the allocation. If there is already an allocated block of memory, the previous allocation is released.
|
| |
| constexpr void | callocate (size_t n, align_t align=zero< align_t >()) noexcept |
| | Allocate a block of memory for the allocation. If there is already an allocated block of memory, the previous allocation is released.
|
| |
|
constexpr void | deallocate () noexcept |
| | Release the block of memory.
|
| |
|
constexpr void | reallocate (size_t n, align_t align=zero< align_t >()) noexcept |
| | Reallocate the block with a new size. Contents are copied to the new allocation.
|
| |
|
constexpr void | creallocate (size_t n, align_t align=zero< align_t >()) noexcept |
| | Reallocate the block with a new size. Contents are copied to the new allocation.
|
| |
|
constexpr void | clear () noexcept |
| | Clear the block of memory, setting all bytes to 0.
|
| |
| constexpr size_t | size () const |
| | Getter for the byte size of the allocation.
|
| |
| constexpr size_t | capacity () const |
| | Getter for the number of elements n of type T that the allocation can hold.
|
| |
| constexpr value_t * | data () |
| | Getter for the real pointer to the allocated block of memory.
|
| |
| constexpr const value_t * | data () const |
| | Getter for the real pointer to the allocated block of memory.
|
| |