Radium Engine  1.5.20
Loading...
Searching...
No Matches
Ra::Core::AlignedAllocator< T, Alignment > Class Template Reference

#include <Core/Containers/AlignedAllocator.hpp>

+ Collaboration diagram for Ra::Core::AlignedAllocator< T, Alignment >:

Public Types

using pointer = T*
 
using const_pointer = const T*
 
using reference = T&
 
using const_reference = const T&
 
using value_type = T
 
using size_type = std::size_t
 
using difference_type = ptrdiff_t
 

Public Member Functions

T * address (T &r) const
 
const T * address (const T &s) const
 
std::size_t max_size () const
 
bool operator!= (const AlignedAllocator &other) const
 
void construct (T *const p, const T &t) const
 
void destroy (T *const p) const
 
bool operator== (const AlignedAllocator &) const
 
 AlignedAllocator (const AlignedAllocator &)
 
template<typename U >
 AlignedAllocator (const AlignedAllocator< U, Alignment > &)
 
T * allocate (const std::size_t n) const
 
void deallocate (T *const p, const std::size_t) const
 
template<typename U >
T * allocate (const std::size_t n, const U *) const
 

Detailed Description

template<typename T, std::size_t Alignment>
class Ra::Core::AlignedAllocator< T, Alignment >

Allocator for aligned data. Adapted from https://gist.github.com/donny-dont/1471329 Modified from the Mallocator from Stephan T. Lavavej. http://blogs.msdn.com/b/vcblog/archive/2008/08/28/the-mallocator.aspx July 2021: use aligned_alloc (c++11) instead of platform-dependant mm_malloc

Definition at line 24 of file AlignedAllocator.hpp.

Member Typedef Documentation

◆ const_pointer

template<typename T , std::size_t Alignment>
using Ra::Core::AlignedAllocator< T, Alignment >::const_pointer = const T*

Definition at line 29 of file AlignedAllocator.hpp.

◆ const_reference

template<typename T , std::size_t Alignment>
using Ra::Core::AlignedAllocator< T, Alignment >::const_reference = const T&

Definition at line 31 of file AlignedAllocator.hpp.

◆ difference_type

template<typename T , std::size_t Alignment>
using Ra::Core::AlignedAllocator< T, Alignment >::difference_type = ptrdiff_t

Definition at line 34 of file AlignedAllocator.hpp.

◆ pointer

template<typename T , std::size_t Alignment>
using Ra::Core::AlignedAllocator< T, Alignment >::pointer = T*

Definition at line 28 of file AlignedAllocator.hpp.

◆ reference

template<typename T , std::size_t Alignment>
using Ra::Core::AlignedAllocator< T, Alignment >::reference = T&

Definition at line 30 of file AlignedAllocator.hpp.

◆ size_type

template<typename T , std::size_t Alignment>
using Ra::Core::AlignedAllocator< T, Alignment >::size_type = std::size_t

Definition at line 33 of file AlignedAllocator.hpp.

◆ value_type

template<typename T , std::size_t Alignment>
using Ra::Core::AlignedAllocator< T, Alignment >::value_type = T

Definition at line 32 of file AlignedAllocator.hpp.

Constructor & Destructor Documentation

◆ AlignedAllocator() [1/3]

template<typename T , std::size_t Alignment>
Ra::Core::AlignedAllocator< T, Alignment >::AlignedAllocator ( )
inline

Definition at line 68 of file AlignedAllocator.hpp.

◆ AlignedAllocator() [2/3]

template<typename T , std::size_t Alignment>
Ra::Core::AlignedAllocator< T, Alignment >::AlignedAllocator ( const AlignedAllocator< T, Alignment > & )
inline

Definition at line 70 of file AlignedAllocator.hpp.

◆ AlignedAllocator() [3/3]

template<typename T , std::size_t Alignment>
template<typename U >
Ra::Core::AlignedAllocator< T, Alignment >::AlignedAllocator ( const AlignedAllocator< U, Alignment > & )
inline

Definition at line 73 of file AlignedAllocator.hpp.

◆ ~AlignedAllocator()

template<typename T , std::size_t Alignment>
Ra::Core::AlignedAllocator< T, Alignment >::~AlignedAllocator ( )
inline

Definition at line 75 of file AlignedAllocator.hpp.

Member Function Documentation

◆ address() [1/2]

template<typename T , std::size_t Alignment>
const T * Ra::Core::AlignedAllocator< T, Alignment >::address ( const T & s) const
inline

Definition at line 38 of file AlignedAllocator.hpp.

◆ address() [2/2]

template<typename T , std::size_t Alignment>
T * Ra::Core::AlignedAllocator< T, Alignment >::address ( T & r) const
inline

Definition at line 36 of file AlignedAllocator.hpp.

◆ allocate() [1/2]

template<typename T , std::size_t Alignment>
T * Ra::Core::AlignedAllocator< T, Alignment >::allocate ( const std::size_t n) const
inline

Definition at line 78 of file AlignedAllocator.hpp.

◆ allocate() [2/2]

template<typename T , std::size_t Alignment>
template<typename U >
T * Ra::Core::AlignedAllocator< T, Alignment >::allocate ( const std::size_t n,
const U *  ) const
inline

Definition at line 116 of file AlignedAllocator.hpp.

◆ construct()

template<typename T , std::size_t Alignment>
void Ra::Core::AlignedAllocator< T, Alignment >::construct ( T *const p,
const T & t ) const
inline

Definition at line 54 of file AlignedAllocator.hpp.

◆ deallocate()

template<typename T , std::size_t Alignment>
void Ra::Core::AlignedAllocator< T, Alignment >::deallocate ( T *const p,
const std::size_t  ) const
inline

Definition at line 106 of file AlignedAllocator.hpp.

◆ destroy()

template<typename T , std::size_t Alignment>
void Ra::Core::AlignedAllocator< T, Alignment >::destroy ( T *const p) const
inline

Definition at line 59 of file AlignedAllocator.hpp.

◆ max_size()

template<typename T , std::size_t Alignment>
std::size_t Ra::Core::AlignedAllocator< T, Alignment >::max_size ( ) const
inline

Definition at line 40 of file AlignedAllocator.hpp.

◆ operator!=()

template<typename T , std::size_t Alignment>
bool Ra::Core::AlignedAllocator< T, Alignment >::operator!= ( const AlignedAllocator< T, Alignment > & other) const
inline

Definition at line 52 of file AlignedAllocator.hpp.

◆ operator==()

template<typename T , std::size_t Alignment>
bool Ra::Core::AlignedAllocator< T, Alignment >::operator== ( const AlignedAllocator< T, Alignment > & ) const
inline

Definition at line 64 of file AlignedAllocator.hpp.


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