Allocators
[Common]

Implementations of the STL allocator concept. More...

Classes

class  Dune::DebugAllocator< T >
 Allocators implementation which performs different kind of memory checks. More...
class  Dune::MallocAllocator< T >
 Allocators implementation which simply calls malloc/free. More...
class  Dune::Pool< T, s >
 A memory pool of objects. More...
class  Dune::PoolAllocator< T, s >
 An allocator managing a pool of objects for reuse. More...
class  Dune::PoolAllocator< void, s >

Functions

template<typename T1 , std::size_t t1, typename T2 , std::size_t t2>
bool Dune::operator== (const PoolAllocator< T1, t1 > &, const PoolAllocator< T2, t2 > &)
template<typename T1 , std::size_t t1, typename T2 , std::size_t t2>
bool Dune::operator!= (const PoolAllocator< T1, t1 > &, const PoolAllocator< T2, t2 > &)
template<typename T , std::size_t t1, std::size_t t2>
bool Dune::operator== (const PoolAllocator< T, t1 > &p1, const PoolAllocator< T, t2 > &p2)
template<typename T , std::size_t t1, std::size_t t2>
bool Dune::operator!= (const PoolAllocator< T, t1 > &p1, const PoolAllocator< T, t2 > &p2)
template<typename T , std::size_t t1, std::size_t t2>
bool Dune::operator== (const PoolAllocator< void, t1 > &, const PoolAllocator< T, t2 > &)
template<typename T , std::size_t t1, std::size_t t2>
bool Dune::operator!= (const PoolAllocator< void, t1 > &, const PoolAllocator< T, t2 > &)
template<std::size_t t1, std::size_t t2>
bool Dune::operator== (const PoolAllocator< void, t1 > &p1, const PoolAllocator< void, t2 > &p2)
template<std::size_t t1, std::size_t t2>
bool Dune::operator!= (const PoolAllocator< void, t1 > &p1, const PoolAllocator< void, t2 > &p2)
 Dune::Pool::Pool ()
 Constructor.
 Dune::Pool::~Pool ()
 Destructor.
void Dune::Pool::print (std::ostream &os)
 Print elements in pool for debugging.
void Dune::Pool::free (void *o)
 Free an object.
void * Dune::Pool::allocate ()
 Get a new or recycled object.
 Dune::PoolAllocator::PoolAllocator ()
 Constructor.
pointer Dune::PoolAllocator::allocate (std::size_t n, const_pointer hint=0)
 Allocates objects.
void Dune::PoolAllocator::deallocate (pointer p, std::size_t n)
 Free objects.
void Dune::PoolAllocator::construct (pointer p, const_reference value)
 Construct an object.
void Dune::PoolAllocator::destroy (pointer p)
 Destroy an object without freeing memory.

Detailed Description

Implementations of the STL allocator concept.


Function Documentation

template<class T , std::size_t s>
PoolAllocator< T, s >::pointer Dune::PoolAllocator< T, s >::allocate ( std::size_t  n,
const_pointer  hint = 0 
) [inline, inherited]

Allocates objects.

Parameters:
n The number of objects to allocate. Has to be one!
hint Ignored hint.
Returns:
A pointer tp the allocated elements.
template<class T , std::size_t S>
void * Dune::Pool< T, S >::allocate (  )  [inline, inherited]

Get a new or recycled object.

Returns:
A pointer to the object memory.
template<class T , std::size_t s>
void Dune::PoolAllocator< T, s >::construct ( pointer  p,
const_reference  value 
) [inline, inherited]

Construct an object.

Parameters:
p Pointer to the object.
value The value to initialize it to.
template<class T , std::size_t s>
void Dune::PoolAllocator< T, s >::deallocate ( pointer  p,
std::size_t  n 
) [inline, inherited]

Free objects.

Does not call the destructor!

Parameters:
n The number of objects to free. Has to be one!
p Pointer to the first object.
template<class T , std::size_t s>
void Dune::PoolAllocator< T, s >::destroy ( pointer  p  )  [inline, inherited]

Destroy an object without freeing memory.

Parameters:
p Pointer to the object.
template<class T , std::size_t S>
void Dune::Pool< T, S >::free ( void *  o  )  [inline, inherited]

Free an object.

Parameters:
o The pointer to memory block of the object.
template<std::size_t t1, std::size_t t2>
bool Dune::operator!= ( const PoolAllocator< void, t1 > &  p1,
const PoolAllocator< void, t2 > &  p2 
) [inline]
template<typename T , std::size_t t1, std::size_t t2>
bool Dune::operator!= ( const PoolAllocator< void, t1 > &  ,
const PoolAllocator< T, t2 > &   
) [inline]
template<typename T , std::size_t t1, std::size_t t2>
bool Dune::operator!= ( const PoolAllocator< T, t1 > &  p1,
const PoolAllocator< T, t2 > &  p2 
) [inline]
template<typename T1 , std::size_t t1, typename T2 , std::size_t t2>
bool Dune::operator!= ( const PoolAllocator< T1, t1 > &  ,
const PoolAllocator< T2, t2 > &   
) [inline]
template<std::size_t t1, std::size_t t2>
bool Dune::operator== ( const PoolAllocator< void, t1 > &  p1,
const PoolAllocator< void, t2 > &  p2 
) [inline]
template<typename T , std::size_t t1, std::size_t t2>
bool Dune::operator== ( const PoolAllocator< void, t1 > &  ,
const PoolAllocator< T, t2 > &   
) [inline]
template<typename T , std::size_t t1, std::size_t t2>
bool Dune::operator== ( const PoolAllocator< T, t1 > &  p1,
const PoolAllocator< T, t2 > &  p2 
) [inline]
template<typename T1 , std::size_t t1, typename T2 , std::size_t t2>
bool Dune::operator== ( const PoolAllocator< T1, t1 > &  ,
const PoolAllocator< T2, t2 > &   
) [inline]
template<class T , std::size_t S>
Dune::Pool< T, S >::Pool (  )  [inline, inherited]

Constructor.

template<class T , std::size_t s>
Dune::PoolAllocator< T, s >::PoolAllocator (  )  [inline, inherited]

Constructor.

template<class T , std::size_t S>
void Dune::Pool< T, S >::print ( std::ostream &  os  )  [inline, inherited]

Print elements in pool for debugging.

template<class T , std::size_t S>
Dune::Pool< T, S >::~Pool (  )  [inline, inherited]

Destructor.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 25 Mar 2018 for dune-common by  doxygen 1.6.1