Open
Graph Drawing
Framework

 v.2012.05
 

ogdf::EFreeListIndexPool< E, next, index > Class Template Reference

More complex implementation of a FreeList, which is able to generate indeices for the elements. More...

#include <ogdf/basic/EFreeList.h>

List of all members.

Public Member Functions

 EFreeListIndexPool ()
 Creates a new IndexPool and a FreeList.
void free (E *ptr)
 Frees an element using the FreeList.
int numUsedIndices () const
 The value indicates that all indices in 0..numUsedIndices-1 might be in use.
E * alloc ()
 Allocates a new Element by either using the free list or allocating a new one with a brand new index.

Protected Attributes

int m_nextFreeIndex
 The next brand new index.
EFreeList< E, next > m_freeList
 The free list for allocating the memory.

Detailed Description

template<typename E, E *E::* next, int E::* index>
class ogdf::EFreeListIndexPool< E, next, index >

More complex implementation of a FreeList, which is able to generate indeices for the elements.

Definition at line 100 of file EFreeList.h.


Constructor & Destructor Documentation

template<typename E, E *E::* next, int E::* index>
ogdf::EFreeListIndexPool< E, next, index >::EFreeListIndexPool ( ) [inline]

Creates a new IndexPool and a FreeList.

Definition at line 104 of file EFreeList.h.


Member Function Documentation

template<typename E, E *E::* next, int E::* index>
E* ogdf::EFreeListIndexPool< E, next, index >::alloc ( ) [inline]

Allocates a new Element by either using the free list or allocating a new one with a brand new index.

Definition at line 113 of file EFreeList.h.

template<typename E, E *E::* next, int E::* index>
void ogdf::EFreeListIndexPool< E, next, index >::free ( E *  ptr) [inline]

Frees an element using the FreeList.

Definition at line 107 of file EFreeList.h.

template<typename E, E *E::* next, int E::* index>
int ogdf::EFreeListIndexPool< E, next, index >::numUsedIndices ( ) const [inline]

The value indicates that all indices in 0..numUsedIndices-1 might be in use.

Definition at line 110 of file EFreeList.h.


Member Data Documentation

template<typename E, E *E::* next, int E::* index>
EFreeList<E, next> ogdf::EFreeListIndexPool< E, next, index >::m_freeList [protected]

The free list for allocating the memory.

Definition at line 131 of file EFreeList.h.

template<typename E, E *E::* next, int E::* index>
int ogdf::EFreeListIndexPool< E, next, index >::m_nextFreeIndex [protected]

The next brand new index.

Definition at line 128 of file EFreeList.h.


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