MOAB  4.9.3pre
Eigen::aligned_allocator< T > Class Template Reference

STL compatible allocator to use with with 16 byte aligned types. More...

#include <Memory.h>

List of all members.

Classes

struct  rebind

Public Types

typedef size_t size_type
typedef std::ptrdiff_t difference_type
typedef Tpointer
typedef const Tconst_pointer
typedef Treference
typedef const Tconst_reference
typedef T value_type

Public Member Functions

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

Detailed Description

template<class T>
class Eigen::aligned_allocator< T >

STL compatible allocator to use with with 16 byte aligned types.

Example:

 // Matrix4f requires 16 bytes alignment:
 std::map< int, Matrix4f, std::less<int>, 
           aligned_allocator<std::pair<const int, Matrix4f> > > my_map_mat4;
 // Vector3f does not require 16 bytes alignment, no need to use Eigen's allocator:
 std::map< int, Vector3f > my_map_vec3;
See also:
TopicStlContainers.

Definition at line 710 of file Memory.h.


Member Typedef Documentation

template<class T>
typedef const T* Eigen::aligned_allocator< T >::const_pointer

Definition at line 716 of file Memory.h.

template<class T>
typedef const T& Eigen::aligned_allocator< T >::const_reference

Definition at line 718 of file Memory.h.

template<class T>
typedef std::ptrdiff_t Eigen::aligned_allocator< T >::difference_type

Definition at line 714 of file Memory.h.

template<class T>
typedef T* Eigen::aligned_allocator< T >::pointer

Definition at line 715 of file Memory.h.

template<class T>
typedef T& Eigen::aligned_allocator< T >::reference

Definition at line 717 of file Memory.h.

template<class T>
typedef size_t Eigen::aligned_allocator< T >::size_type

Definition at line 713 of file Memory.h.

template<class T>
typedef T Eigen::aligned_allocator< T >::value_type

Definition at line 719 of file Memory.h.


Constructor & Destructor Documentation

template<class T>
Eigen::aligned_allocator< T >::aligned_allocator ( ) [inline]

Definition at line 727 of file Memory.h.

: std::allocator<T>() {}
template<class T>
Eigen::aligned_allocator< T >::aligned_allocator ( const aligned_allocator< T > &  other) [inline]

Definition at line 729 of file Memory.h.

: std::allocator<T>(other) {}
template<class T>
template<class U >
Eigen::aligned_allocator< T >::aligned_allocator ( const aligned_allocator< U > &  other) [inline]

Definition at line 732 of file Memory.h.

: std::allocator<T>(other) {}
template<class T>
Eigen::aligned_allocator< T >::~aligned_allocator ( ) [inline]

Definition at line 734 of file Memory.h.

{}

Member Function Documentation

template<class T>
pointer Eigen::aligned_allocator< T >::allocate ( size_type  num,
const void *  = 0 
) [inline]

Definition at line 736 of file Memory.h.

  {
    internal::check_size_for_overflow<T>(num);
    return static_cast<pointer>( internal::aligned_malloc(num * sizeof(T)) );
  }
template<class T>
void Eigen::aligned_allocator< T >::deallocate ( pointer  p,
size_type   
) [inline]

Definition at line 742 of file Memory.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines