dune-common  2.5.0
Classes | Public Types | Public Member Functions | List of all members
Dune::MallocAllocator< T > Class Template Reference

Allocators implementation which simply calls malloc/free. More...

#include <dune/common/mallocallocator.hh>

Classes

struct  rebind
 

Public Types

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

Public Member Functions

 MallocAllocator () throw ()
 create a new MallocAllocator More...
 
template<class U >
 MallocAllocator (const MallocAllocator< U > &) throw ()
 copy construct from an other MallocAllocator, possibly for a different result type More...
 
 ~MallocAllocator () throw ()
 cleanup this allocator More...
 
pointer address (reference x) const
 
const_pointer address (const_reference x) const
 
pointer allocate (size_type n, const void *hint=0)
 allocate n objects of type T More...
 
void deallocate (pointer p, size_type n)
 deallocate n objects of type T at address p More...
 
size_type max_size () const throw ()
 max size for allocate More...
 
void construct (pointer p, const T &val)
 copy-construct an object of type T (i.e. make a placement new on p) More...
 
template<typename ... _Args>
void construct (pointer p, _Args &&... __args)
 construct an object of type T from variadic parameters More...
 
void destroy (pointer p)
 destroy an object of type T (i.e. call the destructor) More...
 

Detailed Description

template<class T>
class Dune::MallocAllocator< T >

Allocators implementation which simply calls malloc/free.

Member Typedef Documentation

§ const_pointer

template<class T>
typedef const T* Dune::MallocAllocator< T >::const_pointer

§ const_reference

template<class T>
typedef const T& Dune::MallocAllocator< T >::const_reference

§ difference_type

template<class T>
typedef std::ptrdiff_t Dune::MallocAllocator< T >::difference_type

§ pointer

template<class T>
typedef T* Dune::MallocAllocator< T >::pointer

§ reference

template<class T>
typedef T& Dune::MallocAllocator< T >::reference

§ size_type

template<class T>
typedef std::size_t Dune::MallocAllocator< T >::size_type

§ value_type

template<class T>
typedef T Dune::MallocAllocator< T >::value_type

Constructor & Destructor Documentation

§ MallocAllocator() [1/2]

template<class T>
Dune::MallocAllocator< T >::MallocAllocator ( )
throw (
)
inline

create a new MallocAllocator

§ MallocAllocator() [2/2]

template<class T>
template<class U >
Dune::MallocAllocator< T >::MallocAllocator ( const MallocAllocator< U > &  )
throw (
)
inline

copy construct from an other MallocAllocator, possibly for a different result type

§ ~MallocAllocator()

template<class T>
Dune::MallocAllocator< T >::~MallocAllocator ( )
throw (
)
inline

cleanup this allocator

Member Function Documentation

§ address() [1/2]

template<class T>
pointer Dune::MallocAllocator< T >::address ( reference  x) const
inline

§ address() [2/2]

template<class T>
const_pointer Dune::MallocAllocator< T >::address ( const_reference  x) const
inline

§ allocate()

template<class T>
pointer Dune::MallocAllocator< T >::allocate ( size_type  n,
const void *  hint = 0 
)
inline

allocate n objects of type T

§ construct() [1/2]

template<class T>
void Dune::MallocAllocator< T >::construct ( pointer  p,
const T &  val 
)
inline

copy-construct an object of type T (i.e. make a placement new on p)

§ construct() [2/2]

template<class T>
template<typename ... _Args>
void Dune::MallocAllocator< T >::construct ( pointer  p,
_Args &&...  __args 
)
inline

construct an object of type T from variadic parameters

§ deallocate()

template<class T>
void Dune::MallocAllocator< T >::deallocate ( pointer  p,
size_type  n 
)
inline

deallocate n objects of type T at address p

§ destroy()

template<class T>
void Dune::MallocAllocator< T >::destroy ( pointer  p)
inline

destroy an object of type T (i.e. call the destructor)

§ max_size()

template<class T>
size_type Dune::MallocAllocator< T >::max_size ( ) const
throw (
)
inline

max size for allocate


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