Zero  0.1.0
Classes | Public Types | Public Member Functions | List of all members
memalign_allocator< T, Alignment > Class Template Reference

#include <allocator.h>

Classes

struct  rebind
 

Public Types

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

Public Member Functions

 memalign_allocator () throw ()
 
 memalign_allocator (const memalign_allocator &) throw ()
 
template<class U >
 memalign_allocator (const memalign_allocator< U, Alignment > &) throw ()
 
 ~memalign_allocator () throw ()
 
pointer address (reference r)
 
const_pointer address (const_reference r) const
 
void construct (pointer p, const_reference value)
 
void destroy (pointer p)
 
size_type max_size () const throw ()
 
bool operator== (const memalign_allocator &)
 
bool operator!= (const memalign_allocator &rhs)
 
pointer allocate (size_type count, const_pointer=0)
 
void deallocate (pointer p, size_t=1)
 

Detailed Description

template<typename T, size_t Alignment = sizeof(T)>
class memalign_allocator< T, Alignment >

C++ STL allocator that uses posix_memalign. Used for direct I/O buffers. Adapted from: http://jmabille.github.io/blog/2014/12/06/aligned-memory-allocator/

Member Typedef Documentation

§ const_pointer

template<typename T, size_t Alignment = sizeof(T)>
typedef const T* memalign_allocator< T, Alignment >::const_pointer

§ const_reference

template<typename T, size_t Alignment = sizeof(T)>
typedef const T& memalign_allocator< T, Alignment >::const_reference

§ difference_type

template<typename T, size_t Alignment = sizeof(T)>
typedef std::ptrdiff_t memalign_allocator< T, Alignment >::difference_type

§ pointer

template<typename T, size_t Alignment = sizeof(T)>
typedef T* memalign_allocator< T, Alignment >::pointer

§ reference

template<typename T, size_t Alignment = sizeof(T)>
typedef T& memalign_allocator< T, Alignment >::reference

§ size_type

template<typename T, size_t Alignment = sizeof(T)>
typedef std::size_t memalign_allocator< T, Alignment >::size_type

§ value_type

template<typename T, size_t Alignment = sizeof(T)>
typedef T memalign_allocator< T, Alignment >::value_type

Constructor & Destructor Documentation

§ memalign_allocator() [1/3]

template<typename T, size_t Alignment = sizeof(T)>
memalign_allocator< T, Alignment >::memalign_allocator ( )
throw (
)
inline

§ memalign_allocator() [2/3]

template<typename T, size_t Alignment = sizeof(T)>
memalign_allocator< T, Alignment >::memalign_allocator ( const memalign_allocator< T, Alignment > &  )
throw (
)
inline

§ memalign_allocator() [3/3]

template<typename T, size_t Alignment = sizeof(T)>
template<class U >
memalign_allocator< T, Alignment >::memalign_allocator ( const memalign_allocator< U, Alignment > &  )
throw (
)
inline

§ ~memalign_allocator()

template<typename T, size_t Alignment = sizeof(T)>
memalign_allocator< T, Alignment >::~memalign_allocator ( )
throw (
)
inline

Member Function Documentation

§ address() [1/2]

template<typename T, size_t Alignment = sizeof(T)>
pointer memalign_allocator< T, Alignment >::address ( reference  r)
inline

§ address() [2/2]

template<typename T, size_t Alignment = sizeof(T)>
const_pointer memalign_allocator< T, Alignment >::address ( const_reference  r) const
inline

§ allocate()

template<typename T, size_t Alignment = sizeof(T)>
pointer memalign_allocator< T, Alignment >::allocate ( size_type  count,
const_pointer  = 0 
)
inline

§ construct()

template<typename T, size_t Alignment = sizeof(T)>
void memalign_allocator< T, Alignment >::construct ( pointer  p,
const_reference  value 
)
inline

§ deallocate()

template<typename T, size_t Alignment = sizeof(T)>
void memalign_allocator< T, Alignment >::deallocate ( pointer  p,
size_t  = 1 
)
inline

§ destroy()

template<typename T, size_t Alignment = sizeof(T)>
void memalign_allocator< T, Alignment >::destroy ( pointer  p)
inline

§ max_size()

template<typename T, size_t Alignment = sizeof(T)>
size_type memalign_allocator< T, Alignment >::max_size ( ) const
throw (
)
inline

§ operator!=()

template<typename T, size_t Alignment = sizeof(T)>
bool memalign_allocator< T, Alignment >::operator!= ( const memalign_allocator< T, Alignment > &  rhs)
inline

§ operator==()

template<typename T, size_t Alignment = sizeof(T)>
bool memalign_allocator< T, Alignment >::operator== ( const memalign_allocator< T, Alignment > &  )
inline

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