CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::ShortAllocator< T, N, Align > Class Template Reference

#include <CeresEngine/Foundation/Allocator.hpp>

Classes

struct  rebind
 

Public Types

using ValueType = T
 
using ArenaType = Arena< size *sizeof(T), alignment >
 
using value_type = ValueType
 

Public Member Functions

 ShortAllocator (const ShortAllocator &)=default
 
ShortAllocatoroperator= (const ShortAllocator &)=delete
 
 ShortAllocator (ArenaType &a) noexcept
 
template<class U >
 ShortAllocator (const ShortAllocator< U, N, alignment > &a) noexcept
 
Tallocate (const std::size_t n)
 
void deallocate (T *p, const std::size_t n) noexcept
 

Static Public Attributes

static auto constexpr alignment = Align
 
static auto constexpr size = N
 

Private Attributes

ArenaType mArena
 

Friends

template<class U , std::size_t M, std::size_t A>
class ShortAllocator
 
template<class T1 , std::size_t N1, std::size_t A1, class U , std::size_t M, std::size_t A2>
bool operator== (const ShortAllocator< T1, N1, A1 > &x, const ShortAllocator< U, M, A2 > &y) noexcept
 

Member Typedef Documentation

◆ ArenaType

template<class T , std::size_t N, std::size_t Align = alignof(std::max_align_t)>
using CeresEngine::ShortAllocator< T, N, Align >::ArenaType = Arena<size * sizeof(T), alignment>

◆ value_type

template<class T , std::size_t N, std::size_t Align = alignof(std::max_align_t)>
using CeresEngine::ShortAllocator< T, N, Align >::value_type = ValueType

◆ ValueType

template<class T , std::size_t N, std::size_t Align = alignof(std::max_align_t)>
using CeresEngine::ShortAllocator< T, N, Align >::ValueType = T

Constructor & Destructor Documentation

◆ ShortAllocator() [1/3]

template<class T , std::size_t N, std::size_t Align = alignof(std::max_align_t)>
CeresEngine::ShortAllocator< T, N, Align >::ShortAllocator ( const ShortAllocator< T, N, Align > &  )
default

◆ ShortAllocator() [2/3]

template<class T , std::size_t N, std::size_t Align = alignof(std::max_align_t)>
CeresEngine::ShortAllocator< T, N, Align >::ShortAllocator ( ArenaType a)
inlinenoexcept

◆ ShortAllocator() [3/3]

template<class T , std::size_t N, std::size_t Align = alignof(std::max_align_t)>
template<class U >
CeresEngine::ShortAllocator< T, N, Align >::ShortAllocator ( const ShortAllocator< U, N, alignment > &  a)
inlinenoexcept

Member Function Documentation

◆ allocate()

template<class T , std::size_t N, std::size_t Align = alignof(std::max_align_t)>
T * CeresEngine::ShortAllocator< T, N, Align >::allocate ( const std::size_t  n)
inline

◆ deallocate()

template<class T , std::size_t N, std::size_t Align = alignof(std::max_align_t)>
void CeresEngine::ShortAllocator< T, N, Align >::deallocate ( T p,
const std::size_t  n 
)
inlinenoexcept

◆ operator=()

template<class T , std::size_t N, std::size_t Align = alignof(std::max_align_t)>
ShortAllocator & CeresEngine::ShortAllocator< T, N, Align >::operator= ( const ShortAllocator< T, N, Align > &  )
delete

Friends And Related Symbol Documentation

◆ operator==

template<class T , std::size_t N, std::size_t Align = alignof(std::max_align_t)>
template<class T1 , std::size_t N1, std::size_t A1, class U , std::size_t M, std::size_t A2>
bool operator== ( const ShortAllocator< T1, N1, A1 > &  x,
const ShortAllocator< U, M, A2 > &  y 
)
friend

◆ ShortAllocator

template<class T , std::size_t N, std::size_t Align = alignof(std::max_align_t)>
template<class U , std::size_t M, std::size_t A>
friend class ShortAllocator
friend

Member Data Documentation

◆ alignment

template<class T , std::size_t N, std::size_t Align = alignof(std::max_align_t)>
auto constexpr CeresEngine::ShortAllocator< T, N, Align >::alignment = Align
staticconstexpr

◆ mArena

template<class T , std::size_t N, std::size_t Align = alignof(std::max_align_t)>
ArenaType CeresEngine::ShortAllocator< T, N, Align >::mArena
private

◆ size

template<class T , std::size_t N, std::size_t Align = alignof(std::max_align_t)>
auto constexpr CeresEngine::ShortAllocator< T, N, Align >::size = N
staticconstexpr

The documentation for this class was generated from the following file: