MRPT  2.0.4
List of all members | Classes | Public Types | Public Member Functions | Public Attributes
mrpt::aligned_allocator_cpp11< T, AligmentBytes > Class Template Reference

Detailed Description

template<class T, size_t AligmentBytes = MRPT_MAX_ALIGN_BYTES>
class mrpt::aligned_allocator_cpp11< T, AligmentBytes >

Aligned allocator that is compatible with C++11.

Default alignment can be 16 (default), 32 (if AVX is defined) or 64 (if AVX2 is defined). See: https://bitbucket.org/eigen/eigen/commits/f5b7700

This was used (before May-2019) to provide custom STL aligned containers, but the new(n,m) addition to C++17 rendered this needless (at last!) See: http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1409

Anyway, this allocator class is left here just in case it is needed for something else.

Definition at line 37 of file aligned_allocator.h.

#include <mrpt/core/aligned_allocator.h>

Inheritance diagram for mrpt::aligned_allocator_cpp11< T, AligmentBytes >:

Classes

struct  rebind
 

Public Types

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

Public Member Functions

 aligned_allocator_cpp11 ()
 
 aligned_allocator_cpp11 (const aligned_allocator_cpp11 &other)
 
template<class U >
 aligned_allocator_cpp11 (const aligned_allocator_cpp11< U > &other)
 
 ~aligned_allocator_cpp11 ()=default
 
pointer allocate (size_type num, const void *=nullptr)
 
void deallocate (pointer p, size_type)
 

Public Attributes

elements
 STL member. More...
 

Member Typedef Documentation

◆ const_pointer

template<class T, size_t AligmentBytes = MRPT_MAX_ALIGN_BYTES>
using mrpt::aligned_allocator_cpp11< T, AligmentBytes >::const_pointer = const T*

Definition at line 43 of file aligned_allocator.h.

◆ const_reference

template<class T, size_t AligmentBytes = MRPT_MAX_ALIGN_BYTES>
using mrpt::aligned_allocator_cpp11< T, AligmentBytes >::const_reference = const T&

Definition at line 45 of file aligned_allocator.h.

◆ difference_type

template<class T, size_t AligmentBytes = MRPT_MAX_ALIGN_BYTES>
using mrpt::aligned_allocator_cpp11< T, AligmentBytes >::difference_type = std::ptrdiff_t

Definition at line 41 of file aligned_allocator.h.

◆ pointer

template<class T, size_t AligmentBytes = MRPT_MAX_ALIGN_BYTES>
using mrpt::aligned_allocator_cpp11< T, AligmentBytes >::pointer = T*

Definition at line 42 of file aligned_allocator.h.

◆ reference

template<class T, size_t AligmentBytes = MRPT_MAX_ALIGN_BYTES>
using mrpt::aligned_allocator_cpp11< T, AligmentBytes >::reference = T&

Definition at line 44 of file aligned_allocator.h.

◆ size_type

template<class T, size_t AligmentBytes = MRPT_MAX_ALIGN_BYTES>
using mrpt::aligned_allocator_cpp11< T, AligmentBytes >::size_type = std::size_t

Definition at line 40 of file aligned_allocator.h.

◆ value_type

template<class T, size_t AligmentBytes = MRPT_MAX_ALIGN_BYTES>
using mrpt::aligned_allocator_cpp11< T, AligmentBytes >::value_type = T

Definition at line 46 of file aligned_allocator.h.

Constructor & Destructor Documentation

◆ aligned_allocator_cpp11() [1/3]

template<class T, size_t AligmentBytes = MRPT_MAX_ALIGN_BYTES>
mrpt::aligned_allocator_cpp11< T, AligmentBytes >::aligned_allocator_cpp11 ( )
inline

Definition at line 54 of file aligned_allocator.h.

◆ aligned_allocator_cpp11() [2/3]

template<class T, size_t AligmentBytes = MRPT_MAX_ALIGN_BYTES>
mrpt::aligned_allocator_cpp11< T, AligmentBytes >::aligned_allocator_cpp11 ( const aligned_allocator_cpp11< T, AligmentBytes > &  other)
inline

Definition at line 55 of file aligned_allocator.h.

◆ aligned_allocator_cpp11() [3/3]

template<class T, size_t AligmentBytes = MRPT_MAX_ALIGN_BYTES>
template<class U >
mrpt::aligned_allocator_cpp11< T, AligmentBytes >::aligned_allocator_cpp11 ( const aligned_allocator_cpp11< U > &  other)
inline

Definition at line 60 of file aligned_allocator.h.

◆ ~aligned_allocator_cpp11()

template<class T, size_t AligmentBytes = MRPT_MAX_ALIGN_BYTES>
mrpt::aligned_allocator_cpp11< T, AligmentBytes >::~aligned_allocator_cpp11 ( )
default

Member Function Documentation

◆ allocate()

template<class T, size_t AligmentBytes = MRPT_MAX_ALIGN_BYTES>
pointer mrpt::aligned_allocator_cpp11< T, AligmentBytes >::allocate ( size_type  num,
const void *  = nullptr 
)
inline

Definition at line 65 of file aligned_allocator.h.

References mrpt::aligned_malloc().

Here is the call graph for this function:

◆ deallocate()

template<class T, size_t AligmentBytes = MRPT_MAX_ALIGN_BYTES>
void mrpt::aligned_allocator_cpp11< T, AligmentBytes >::deallocate ( pointer  p,
size_type   
)
inline

Definition at line 70 of file aligned_allocator.h.

References mrpt::aligned_free().

Here is the call graph for this function:

Member Data Documentation

◆ elements

T std::allocator< T >::elements
inherited

STL member.




Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020