libER 0.1.4.2
ELDEN RING API library
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Friends | List of all members
from::allocator< T, AllocatorTag > Class Template Reference

The main libER stand-in for ER allocator proxies. More...

#include <from_allocator.hpp>

Inheritance diagram for from::allocator< T, AllocatorTag >:
from::allocator_base< AllocatorTag >

Public Types

using value_type = T
 The allocated value type.
 
using size_type = size_t
 Memory size type.
 
using difference_type = ptrdiff_t
 Memory difference type.
 
using propagate_on_container_move_assignment = std::true_type
 This allocator is move assigned along with the contents.
 
using is_always_equal = std::false_type
 This allocator may proxy different stateful allocators.
 

Public Member Functions

template<typename U >
 allocator (const allocator< U > &other) noexcept
 Allocator copy constructor.
 
 allocator (DLKR::DLAllocator *dl_allocator) noexcept
 Wrap an existing DLKR::DLAllocator.
 
T * allocate (size_type n)
 Allocate n instances of uninitialized memory for T.
 
void deallocate (T *p, size_type n=0)
 Deallocate previously allocated memory.
 

Friends

template<typename T1 , typename T2 >
bool operator== (const allocator< T1 > &lhs, const allocator< T2 > &rhs) noexcept
 Allocator equality comparison friend declaration.
 

Detailed Description

template<typename T, typename AllocatorTag = default_allocator_tag>
class from::allocator< T, AllocatorTag >

The main libER stand-in for ER allocator proxies.

Uses the DLKR::DLAllocator interface and fulfils allocator completeness requirements.

Template Parameters
Tallocated type
AllocatorTagallocator tag, most often default_allocator_tag or default_empty_base_allocator_tag

Member Typedef Documentation

◆ is_always_equal

template<typename T , typename AllocatorTag = default_allocator_tag>
using from::allocator< T, AllocatorTag >::is_always_equal = std::false_type

This allocator may proxy different stateful allocators.

Equality checks via operator == are required on assignment.

Constructor & Destructor Documentation

◆ allocator() [1/2]

template<typename T , typename AllocatorTag = default_allocator_tag>
template<typename U >
from::allocator< T, AllocatorTag >::allocator ( const allocator< U > &  other)
inlinenoexcept

Allocator copy constructor.

Required by allocator completeness requirements.

Template Parameters
Uother allocated type
Parameters
other

◆ allocator() [2/2]

template<typename T , typename AllocatorTag = default_allocator_tag>
from::allocator< T, AllocatorTag >::allocator ( DLKR::DLAllocator dl_allocator)
inlinenoexcept

Wrap an existing DLKR::DLAllocator.

Parameters
dl_allocatorthe allocator to use

Member Function Documentation

◆ allocate()

template<typename T , typename AllocatorTag = default_allocator_tag>
T * from::allocator< T, AllocatorTag >::allocate ( size_type  n)
inline

Allocate n instances of uninitialized memory for T.

Parameters
ncount of instances to allocate
Returns
T* pointer to allocated memory

◆ deallocate()

template<typename T , typename AllocatorTag = default_allocator_tag>
void from::allocator< T, AllocatorTag >::deallocate ( T *  p,
size_type  n = 0 
)
inline

Deallocate previously allocated memory.

Parameters
ppointer to the memory to deallocate
nis ignored by DLKR::DLAllocator and can be zero

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