Grappa  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 34 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 52 of file PoolAllocator.hpp.

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

Definition at line 58 of file PoolAllocator.hpp.

Member Function Documentation

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

Definition at line 41 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 69 of file PoolAllocator.hpp.

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

Definition at line 78 of file PoolAllocator.hpp.

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

Definition at line 54 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 38 of file PoolAllocator.hpp.

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

Definition at line 36 of file PoolAllocator.hpp.

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

Definition at line 37 of file PoolAllocator.hpp.

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

Definition at line 39 of file PoolAllocator.hpp.


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