Open
Graph Drawing
Framework

 v.2012.05
 

ogdf::EFreeList< E, next > Class Template Reference

Simple implementation of a FreeList which buffers the memory allocation of an embedded list item. More...

#include <ogdf/basic/EFreeList.h>

List of all members.

Public Member Functions

 EFreeList ()
 Constructs a new freelist.
 ~EFreeList ()
 Destructor. Releases the mem used by the remaining elements on the stack.
E * alloc ()
 Returns a new instance of E by either using an instance from the stack or creating a new one.
bool empty () const
 Returns true if the stack is empty.
void free (E *ptr)
 Frees an item buy putting it onto the stack of free instances.

Protected Types

typedef EStack< EFreeList< E,
next >, E,&EFreeList< E, next >
::m_pTop, next > 
FreeStack
 Typedef for the embedded stack.

Protected Member Functions

void freeFreeList ()
 deletes all instances in the list

Protected Attributes

E * m_pTop
 Top of the stack.

Detailed Description

template<typename E, E *E::* next>
class ogdf::EFreeList< E, next >

Simple implementation of a FreeList which buffers the memory allocation of an embedded list item.

Definition at line 60 of file EFreeList.h.


Member Typedef Documentation

template<typename E, E *E::* next>
typedef EStack<EFreeList<E, next>, E, &EFreeList<E, next>::m_pTop, next> ogdf::EFreeList< E, next >::FreeStack [protected]

Typedef for the embedded stack.

Definition at line 95 of file EFreeList.h.


Constructor & Destructor Documentation

template<typename E, E *E::* next>
ogdf::EFreeList< E, next >::EFreeList ( ) [inline]

Constructs a new freelist.

Definition at line 64 of file EFreeList.h.

template<typename E, E *E::* next>
ogdf::EFreeList< E, next >::~EFreeList ( ) [inline]

Destructor. Releases the mem used by the remaining elements on the stack.

Definition at line 67 of file EFreeList.h.


Member Function Documentation

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

Returns a new instance of E by either using an instance from the stack or creating a new one.

Definition at line 70 of file EFreeList.h.

template<typename E, E *E::* next>
bool ogdf::EFreeList< E, next >::empty ( ) const [inline]

Returns true if the stack is empty.

Definition at line 79 of file EFreeList.h.

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

Frees an item buy putting it onto the stack of free instances.

Definition at line 82 of file EFreeList.h.

template<typename E, E *E::* next>
void ogdf::EFreeList< E, next >::freeFreeList ( ) [inline, protected]

deletes all instances in the list

Definition at line 86 of file EFreeList.h.


Member Data Documentation

template<typename E, E *E::* next>
E* ogdf::EFreeList< E, next >::m_pTop [protected]

Top of the stack.

Definition at line 92 of file EFreeList.h.


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