More complex implementation of a FreeList, which is able to generate indeices for the elements. More...
#include <ogdf/basic/EFreeList.h>
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. | |
More complex implementation of a FreeList, which is able to generate indeices for the elements.
Definition at line 100 of file EFreeList.h.
| ogdf::EFreeListIndexPool< E, next, index >::EFreeListIndexPool | ( | ) | [inline] |
Creates a new IndexPool and a FreeList.
Definition at line 104 of file EFreeList.h.
| 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.
| void ogdf::EFreeListIndexPool< E, next, index >::free | ( | E * | ptr | ) | [inline] |
Frees an element using the FreeList.
Definition at line 107 of file EFreeList.h.
| 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.
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.
int ogdf::EFreeListIndexPool< E, next, index >::m_nextFreeIndex [protected] |
The next brand new index.
Definition at line 128 of file EFreeList.h.