iLab Neuromorphic Robotics Toolkit  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nrt::AlignedAllocator< T, N > Class Template Reference

#include <nrt/Core/Memory/Allocation.H>

template<class T, size_t N>
class nrt::AlignedAllocator< T, N >

A c++ STL compatible allocator that always performs aligned allocation.

This differs from nrt::Allocator in that it will always perform aligned allocation regardless of the settings nrt::allocate has been compiled to use. In general this will often mean that this allocator does not use caching. In addition, this allocator has an easier interface in the sense that NRT does not need to be recompiled when the allocation boundary is changed.

Template Parameters
TThe underlying type to allocate
NThe size, in bytes, of the boundary to align to. Must be a power of two.

Definition at line 137 of file Allocation.H.

Inheritance diagram for nrt::AlignedAllocator< T, N >:

Public Types

typedef std::allocator< T >
::size_type 
size_type
 
typedef std::allocator< T >
::difference_type 
difference_type
 
typedef std::allocator< T >
::pointer 
pointer
 
typedef std::allocator< T >
::const_pointer 
const_pointer
 
typedef std::allocator< T >
::reference 
reference
 
typedef std::allocator< T >
::const_reference 
const_reference
 
typedef std::allocator< T >
::value_type 
value_type
 

Public Member Functions

 AlignedAllocator (AlignedAllocator const &other) noexcept
 
template<class U >
 AlignedAllocator (AlignedAllocator< U, N > const &other) noexcept
 
pointer allocate (size_type n, const void *=0)
 
void deallocate (pointer p, size_type)
 

Additional Inherited Members

- Public Attributes inherited from std::allocator< T >
elements
 STL member.
 

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