dune-common 2.10
Loading...
Searching...
No Matches
Dune::PoolAllocator< void, s > Class Template Reference

#include <dune/common/poolallocator.hh>

Inheritance diagram for Dune::PoolAllocator< void, s >:
Inheritance graph

Classes

struct  rebind

Public Types

typedef void * pointer
typedef const void * const_pointer
typedef void value_type
typedef void & reference
 The reference type.
typedef const void & const_reference
 The constant reference type.
typedef std::size_t size_type
 The size type.
typedef std::ptrdiff_t difference_type
 The difference_type.
typedef Pool< void, sizePoolType
 The type of the memory pool we use.

Public Member Functions

 PoolAllocator ()
 Constructor.
pointer allocate (std::size_t n, const_pointer hint=0)
 Allocates objects.
void deallocate (pointer p, std::size_t n)
 Free objects.
void construct (pointer p, const_reference value)
 Construct an object.
void destroy (pointer p)
 Destroy an object without freeing memory.
pointer address (reference x) const
 Convert a reference to a pointer.
int max_size () const noexcept
 Not correctly implemented, yet!

Static Public Attributes

static constexpr int size
 The number of objects to fit into one memory chunk allocated.

Member Typedef Documentation

◆ const_pointer

template<std::size_t s>
typedef const void* Dune::PoolAllocator< void, s >::const_pointer

◆ const_reference

typedef const void& Dune::PoolAllocator< void, s >::const_reference

The constant reference type.

◆ difference_type

typedef std::ptrdiff_t Dune::PoolAllocator< void, s >::difference_type

◆ pointer

template<std::size_t s>
typedef void* Dune::PoolAllocator< void, s >::pointer

◆ PoolType

typedef Pool<void,size> Dune::PoolAllocator< void, s >::PoolType

The type of the memory pool we use.

◆ reference

typedef void& Dune::PoolAllocator< void, s >::reference

The reference type.

◆ size_type

typedef std::size_t Dune::PoolAllocator< void, s >::size_type

The size type.

◆ value_type

template<std::size_t s>
typedef void Dune::PoolAllocator< void, s >::value_type

Constructor & Destructor Documentation

◆ PoolAllocator()

Dune::PoolAllocator< void, s >::PoolAllocator ( )
inline

Constructor.

Member Function Documentation

◆ address()

pointer Dune::PoolAllocator< void, s >::address ( reference x) const
inline

Convert a reference to a pointer.

◆ allocate()

PoolAllocator< void, s >::pointer Dune::PoolAllocator< void, s >::allocate ( std::size_t n,
const_pointer hint = 0 )
inline

Allocates objects.

Parameters
nThe number of objects to allocate. Has to be one!
hintIgnored hint.
Returns
A pointer tp the allocated elements.

◆ construct()

void Dune::PoolAllocator< void, s >::construct ( pointer p,
const_reference value )
inline

Construct an object.

Parameters
pPointer to the object.
valueThe value to initialize it to.

◆ deallocate()

void Dune::PoolAllocator< void, s >::deallocate ( pointer p,
std::size_t n )
inline

Free objects.

Does not call the destructor!

Parameters
nThe number of objects to free. Has to be one!
pPointer to the first object.

◆ destroy()

void Dune::PoolAllocator< void, s >::destroy ( pointer p)
inline

Destroy an object without freeing memory.

Parameters
pPointer to the object.

◆ max_size()

int Dune::PoolAllocator< void, s >::max_size ( ) const
inlinenoexcept

Not correctly implemented, yet!

Member Data Documentation

◆ size

int Dune::PoolAllocator< void, s >::size
staticconstexpr

The number of objects to fit into one memory chunk allocated.


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