cds  1.4.0
Data Structures | Public Types | Public Member Functions
cds::details::Allocator< T, Alloc > Class Template Reference

Extends std::allocator interface to provide semantics like operator new and delete. More...

#include <cds/details/allocator.h>

Inheritance diagram for cds::details::Allocator< T, Alloc >:

Data Structures

struct  rebind
 Rebinds allocator to other type Q instead of T. More...
 

Public Types

typedef Alloc::template rebind
< T >::other 
allocator_type
 Underlying allocator type.
 

Public Member Functions

template<typename... S>
T * New (S const &...src)
 Analogue of operator new T(src... )
 
template<typename... Args>
T * MoveNew (Args &&...args)
 Analogue of operator new T( std::forward<Args>(args)... ) (move semantics) More...
 
T * NewArray (size_t nCount)
 Analogue of operator new T[nCount ].
 
template<typename S >
T * NewArray (size_t nCount, S const &src)
 Analogue of operator new T[nCount ]. More...
 
void Delete (T *p)
 Analogue of operator delete.
 
void Delete (T *p, size_t nCount)
 Analogue of operator delete [].
 
template<typename... S>
T * Construct (void *p, S const &...src)
 Analogue of placement operator new( p ) T( src... )
 
template<typename... Args>
T * MoveConstruct (void *p, Args &&...args)
 Analogue of placement operator new( p ) T( std::forward<Args>(args)... ) More...
 

Detailed Description

template<typename T, class Alloc = CDS_DEFAULT_ALLOCATOR>
class cds::details::Allocator< T, Alloc >

Extends std::allocator interface to provide semantics like operator new and delete.

The class is the wrapper around underlying Alloc class. Alloc provides the interface defined in C++ standard.

Member Function Documentation

template<typename T, class Alloc = CDS_DEFAULT_ALLOCATOR>
template<typename... Args>
T* cds::details::Allocator< T, Alloc >::MoveConstruct ( void *  p,
Args &&...  args 
)
inline

Analogue of placement operator new( p ) T( std::forward<Args>(args)... )

This function is available only for compiler that supports variadic template and move semantics

template<typename T, class Alloc = CDS_DEFAULT_ALLOCATOR>
template<typename... Args>
T* cds::details::Allocator< T, Alloc >::MoveNew ( Args &&...  args)
inline

Analogue of operator new T( std::forward<Args>(args)... ) (move semantics)

This function is available only for compiler that supports variadic template and move semantics

template<typename T, class Alloc = CDS_DEFAULT_ALLOCATOR>
template<typename S >
T* cds::details::Allocator< T, Alloc >::NewArray ( size_t  nCount,
S const &  src 
)
inline

Analogue of operator new T[nCount ].

Each item of array of type T is initialized by parameter src: T( src )


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

cds 1.4.0 Developed by Maxim Khiszinsky aka khizmax 2007 - 2012
Autogenerated Mon May 20 2013 00:37:58 by Doxygen 1.8.3.1