RADLib
RADical C++ application framework
RADData::RADMonotonicAllocator< T > Class Template Reference

Standard-compatible allocator backed by RADMonotonicArena. More...

#include <RADDataStructures.h>

Classes

struct  rebind
 Rebinds the allocator to another value type. More...
 

Public Types

using value_type = T
 

Public Member Functions

 RADMonotonicAllocator ()=default
 Creates an allocator without an arena; allocations use std::allocator. More...
 
 RADMonotonicAllocator (RADMonotonicArena *arena)
 Creates an allocator using arena. More...
 
template<typename U >
 RADMonotonicAllocator (const RADMonotonicAllocator< U > &other)
 Converts from another monotonic allocator type. More...
 
T * allocate (size_t n)
 Allocates n objects. More...
 
void deallocate (T *ptr, size_t n)
 No-op for arena allocations; std fallback deallocates normally. More...
 
RADMonotonicArenaarena () const
 Returns backing arena. More...
 

Friends

template<typename U >
class RADMonotonicAllocator
 

Detailed Description

template<typename T>
class RADData::RADMonotonicAllocator< T >

Standard-compatible allocator backed by RADMonotonicArena.

Member Typedef Documentation

◆ value_type

template<typename T >
using RADData::RADMonotonicAllocator< T >::value_type = T

Constructor & Destructor Documentation

◆ RADMonotonicAllocator() [1/3]

template<typename T >
RADData::RADMonotonicAllocator< T >::RADMonotonicAllocator ( )
default

Creates an allocator without an arena; allocations use std::allocator.

◆ RADMonotonicAllocator() [2/3]

template<typename T >
RADData::RADMonotonicAllocator< T >::RADMonotonicAllocator ( RADMonotonicArena arena)
inlineexplicit

Creates an allocator using arena.

◆ RADMonotonicAllocator() [3/3]

template<typename T >
template<typename U >
RADData::RADMonotonicAllocator< T >::RADMonotonicAllocator ( const RADMonotonicAllocator< U > &  other)
inline

Converts from another monotonic allocator type.

Member Function Documentation

◆ allocate()

template<typename T >
T* RADData::RADMonotonicAllocator< T >::allocate ( size_t  n)
inline

Allocates n objects.

◆ arena()

template<typename T >
RADMonotonicArena* RADData::RADMonotonicAllocator< T >::arena ( ) const
inline

Returns backing arena.

◆ deallocate()

template<typename T >
void RADData::RADMonotonicAllocator< T >::deallocate ( T *  ptr,
size_t  n 
)
inline

No-op for arena allocations; std fallback deallocates normally.

Friends And Related Function Documentation

◆ RADMonotonicAllocator

template<typename T >
template<typename U >
friend class RADMonotonicAllocator
friend

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