ergo
mat::Allocator< Treal > Class Template Reference

#include <Allocator.h>

Public Member Functions

 Allocator (int noOfRealsPerBuffer_, int noOfBuffers_)
 
 ~Allocator ()
 
Treal * alloc ()
 
void free (Treal *ptr)
 
bool isFull ()
 
bool isEmpty ()
 
bool ownsPtr (Treal *ptr)
 
int getNoOfOccupiedSlots ()
 

Private Attributes

int noOfRealsPerBuffer
 
int noOfBuffers
 
Treal * buffer
 
int * nextFreeIndexList
 
int firstFreeIndex
 
int noOfOccupiedSlots
 

Constructor & Destructor Documentation

◆ Allocator()

template<class Treal>
mat::Allocator< Treal >::Allocator ( int noOfRealsPerBuffer_,
int noOfBuffers_ )
inline

◆ ~Allocator()

template<class Treal>
mat::Allocator< Treal >::~Allocator ( )
inline

References buffer, and nextFreeIndexList.

Member Function Documentation

◆ alloc()

template<class Treal>
Treal * mat::Allocator< Treal >::alloc ( )
inline

◆ free()

template<class Treal>
void mat::Allocator< Treal >::free ( Treal * ptr)
inline

◆ getNoOfOccupiedSlots()

template<class Treal>
int mat::Allocator< Treal >::getNoOfOccupiedSlots ( )
inline

References noOfOccupiedSlots.

◆ isEmpty()

template<class Treal>
bool mat::Allocator< Treal >::isEmpty ( )
inline

References noOfOccupiedSlots.

◆ isFull()

template<class Treal>
bool mat::Allocator< Treal >::isFull ( )
inline

References noOfBuffers, and noOfOccupiedSlots.

◆ ownsPtr()

template<class Treal>
bool mat::Allocator< Treal >::ownsPtr ( Treal * ptr)
inline

Member Data Documentation

◆ buffer

template<class Treal>
Treal* mat::Allocator< Treal >::buffer
private

◆ firstFreeIndex

template<class Treal>
int mat::Allocator< Treal >::firstFreeIndex
private

Referenced by alloc(), Allocator(), and free().

◆ nextFreeIndexList

template<class Treal>
int* mat::Allocator< Treal >::nextFreeIndexList
private

Referenced by alloc(), Allocator(), free(), and ~Allocator().

◆ noOfBuffers

template<class Treal>
int mat::Allocator< Treal >::noOfBuffers
private

Referenced by Allocator(), free(), isFull(), and ownsPtr().

◆ noOfOccupiedSlots

template<class Treal>
int mat::Allocator< Treal >::noOfOccupiedSlots
private

◆ noOfRealsPerBuffer

template<class Treal>
int mat::Allocator< Treal >::noOfRealsPerBuffer
private

Referenced by alloc(), Allocator(), free(), and ownsPtr().


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