Vlasiator ebf0dd394 on dev (v5.4.0 + 1054 commits)
Loading...
Searching...
No Matches
aligned_allocator< T, Alignment > Class Template Reference

#include <memoryallocation.h>

Classes

struct  rebind

Public Types

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

Public Member Functions

T * address (T &r) const
const T * address (const T &s) const
std::size_t max_size () const
bool operator!= (const aligned_allocator &other) const
void construct (T *const p, const T &t) const
void destroy (T *const p) const
bool operator== (const aligned_allocator &other) const
 aligned_allocator ()
 aligned_allocator (const aligned_allocator &)
template<typename U>
 aligned_allocator (const aligned_allocator< U, Alignment > &)
 ~aligned_allocator ()
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

Private Member Functions

aligned_allocatoroperator= (const aligned_allocator &)

Detailed Description

template<typename T, std::size_t Alignment>
class aligned_allocator< T, Alignment >

Allocator for aligned data.

Copied from https://gist.github.com/1471329 Modified from the Mallocator from Stephan T. Lavavej. http://blogs.msdn.com/b/vcblog/archive/2008/08/28/the-mallocator.aspx

Definition at line 109 of file memoryallocation.h.

Member Typedef Documentation

◆ const_pointer

template<typename T, std::size_t Alignment>
typedef const T* aligned_allocator< T, Alignment >::const_pointer

Definition at line 115 of file memoryallocation.h.

◆ const_reference

template<typename T, std::size_t Alignment>
typedef const T& aligned_allocator< T, Alignment >::const_reference

Definition at line 117 of file memoryallocation.h.

◆ difference_type

template<typename T, std::size_t Alignment>
typedef ptrdiff_t aligned_allocator< T, Alignment >::difference_type

Definition at line 120 of file memoryallocation.h.

◆ pointer

template<typename T, std::size_t Alignment>
typedef T* aligned_allocator< T, Alignment >::pointer

Definition at line 114 of file memoryallocation.h.

◆ reference

template<typename T, std::size_t Alignment>
typedef T& aligned_allocator< T, Alignment >::reference

Definition at line 116 of file memoryallocation.h.

◆ size_type

template<typename T, std::size_t Alignment>
typedef std::size_t aligned_allocator< T, Alignment >::size_type

Definition at line 119 of file memoryallocation.h.

◆ value_type

template<typename T, std::size_t Alignment>
typedef T aligned_allocator< T, Alignment >::value_type

Definition at line 118 of file memoryallocation.h.

Constructor & Destructor Documentation

◆ aligned_allocator() [1/3]

template<typename T, std::size_t Alignment>
aligned_allocator< T, Alignment >::aligned_allocator ( )
inline

Definition at line 175 of file memoryallocation.h.

◆ aligned_allocator() [2/3]

template<typename T, std::size_t Alignment>
aligned_allocator< T, Alignment >::aligned_allocator ( const aligned_allocator< T, Alignment > & )
inline

Definition at line 177 of file memoryallocation.h.

◆ aligned_allocator() [3/3]

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

Definition at line 179 of file memoryallocation.h.

◆ ~aligned_allocator()

template<typename T, std::size_t Alignment>
aligned_allocator< T, Alignment >::~aligned_allocator ( )
inline

Definition at line 181 of file memoryallocation.h.

Member Function Documentation

◆ address() [1/2]

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

Definition at line 127 of file memoryallocation.h.

◆ address() [2/2]

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

Definition at line 122 of file memoryallocation.h.

◆ allocate() [1/2]

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

Definition at line 185 of file memoryallocation.h.

Here is the caller graph for this function:

◆ allocate() [2/2]

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

Definition at line 225 of file memoryallocation.h.

◆ construct()

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

Definition at line 152 of file memoryallocation.h.

◆ deallocate()

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

Definition at line 217 of file memoryallocation.h.

◆ destroy()

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

Definition at line 159 of file memoryallocation.h.

◆ max_size()

template<typename T, std::size_t Alignment>
std::size_t aligned_allocator< T, Alignment >::max_size ( ) const
inline

Definition at line 132 of file memoryallocation.h.

Here is the caller graph for this function:

◆ operator!=()

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

Definition at line 147 of file memoryallocation.h.

◆ operator=()

template<typename T, std::size_t Alignment>
aligned_allocator & aligned_allocator< T, Alignment >::operator= ( const aligned_allocator< T, Alignment > & )
private

◆ operator==()

template<typename T, std::size_t Alignment>
bool aligned_allocator< T, Alignment >::operator== ( const aligned_allocator< T, Alignment > & other) const
inline

Definition at line 167 of file memoryallocation.h.


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