![]() |
Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
|
Provides a way to use untyped allocators like LinearAllocator for containers. More...
#include <AllocatorAdapter.h>
Classes | |
| struct | rebind |
Public Types | |
| using | value_type = T |
| using | propagate_on_container_copy_assignment = std::true_type |
| using | propagate_on_container_move_assignment = std::true_type |
| using | propagate_on_container_swap = std::true_type |
| using | is_always_equal = std::false_type |
Public Member Functions | |
| constexpr | AllocatorAdapter (Allocator &allocator) noexcept |
| template<typename OtherT > | |
| constexpr | AllocatorAdapter (const AllocatorAdapter< OtherT, Allocator > &allocatorAdapter) noexcept |
| constexpr T * | allocate (std::size_t n) |
| constexpr void | deallocate (T *ptr, std::size_t n) |
| template<typename OtherT > | |
| constexpr bool | operator== (const AllocatorAdapter< OtherT, Allocator > &other) const noexcept |
Private Attributes | |
| Allocator * | m_Allocator {nullptr} |
Friends | |
| template<typename OtherT , typename OtherAllocator > | |
| class | AllocatorAdapter |
Provides a way to use untyped allocators like LinearAllocator for containers.
This allocator adapter must not outlive the target allocator. A client must not mix adapters with different allocators.
It provides a basic STL allocator interface. It allows to use a stateful allocator:
std::vector<Type, PS::Memory::AllocatorAdapter<Type, PS::Memory::ScopedLinearAllocator>>
| using PS::Memory::AllocatorAdapter< T, Allocator >::is_always_equal = std::false_type |
| using PS::Memory::AllocatorAdapter< T, Allocator >::propagate_on_container_copy_assignment = std::true_type |
| using PS::Memory::AllocatorAdapter< T, Allocator >::propagate_on_container_move_assignment = std::true_type |
| using PS::Memory::AllocatorAdapter< T, Allocator >::propagate_on_container_swap = std::true_type |
| using PS::Memory::AllocatorAdapter< T, Allocator >::value_type = T |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexprnoexcept |
|
friend |
|
private |