Grappa  r3821, hash 22cd626d567a91ead5b23302066d1e9469f45c66
Grappa::PoolAllocator< Base > Class Template Reference

#include <PoolAllocator.hpp>

Inheritance diagram for Grappa::PoolAllocator< Base >:
Grappa::PoolAllocatorInternal< Bytes, Base >

Public Member Functions

Base * allocate (size_t sz)
 
 PoolAllocator (char *buffer, size_t buffer_size, bool owns_buffer)
 
void reset ()
 
virtual ~PoolAllocator ()
 
template<typename F >
void iterate (F f)
 Takes a lambda (or really any callable) that is called repeated for each allocated Base*. More...
 
size_t remaining ()
 

Public Attributes

char * buffer
 
size_t buffer_size
 
size_t allocated
 
bool owns_buffer
 

Friends

template<typename OtherBase >
void * operator new (size_t, Grappa::PoolAllocator< OtherBase > &)
 

Detailed Description

template<typename Base>
class Grappa::PoolAllocator< Base >

Definition at line 45 of file PoolAllocator.hpp.

Constructor & Destructor Documentation

template<typename Base>
Grappa::PoolAllocator< Base >::PoolAllocator ( char *  buffer,
size_t  buffer_size,
bool  owns_buffer 
)
inline

Definition at line 63 of file PoolAllocator.hpp.

template<typename Base>
virtual Grappa::PoolAllocator< Base >::~PoolAllocator ( )
inlinevirtual

Definition at line 69 of file PoolAllocator.hpp.

Member Function Documentation

template<typename Base>
Base* Grappa::PoolAllocator< Base >::allocate ( size_t  sz)
inline

Definition at line 52 of file PoolAllocator.hpp.

template<typename Base>
template<typename F >
void Grappa::PoolAllocator< Base >::iterate ( f)
inline

Takes a lambda (or really any callable) that is called repeated for each allocated Base*.

Definition at line 80 of file PoolAllocator.hpp.

template<typename Base>
size_t Grappa::PoolAllocator< Base >::remaining ( )
inline

Definition at line 89 of file PoolAllocator.hpp.

template<typename Base>
void Grappa::PoolAllocator< Base >::reset ( )
inline

Definition at line 65 of file PoolAllocator.hpp.

Friends And Related Function Documentation

template<typename Base>
template<typename OtherBase >
void* operator new ( size_t  ,
Grappa::PoolAllocator< OtherBase > &   
)
friend

Member Data Documentation

template<typename Base>
size_t Grappa::PoolAllocator< Base >::allocated

Definition at line 49 of file PoolAllocator.hpp.

template<typename Base>
char* Grappa::PoolAllocator< Base >::buffer

Definition at line 47 of file PoolAllocator.hpp.

template<typename Base>
size_t Grappa::PoolAllocator< Base >::buffer_size

Definition at line 48 of file PoolAllocator.hpp.

template<typename Base>
bool Grappa::PoolAllocator< Base >::owns_buffer

Definition at line 50 of file PoolAllocator.hpp.


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