Simple implementation of a FreeList which buffers the memory allocation of an embedded list item. More...
#include <ogdf/basic/EFreeList.h>
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. | |
Simple implementation of a FreeList which buffers the memory allocation of an embedded list item.
Definition at line 60 of file EFreeList.h.
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.
| ogdf::EFreeList< E, next >::EFreeList | ( | ) | [inline] |
Constructs a new freelist.
Definition at line 64 of file EFreeList.h.
| 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.
| 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.
| bool ogdf::EFreeList< E, next >::empty | ( | ) | const [inline] |
Returns true if the stack is empty.
Definition at line 79 of file EFreeList.h.
| 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.
| void ogdf::EFreeList< E, next >::freeFreeList | ( | ) | [inline, protected] |
deletes all instances in the list
Definition at line 86 of file EFreeList.h.
E* ogdf::EFreeList< E, next >::m_pTop [protected] |
Top of the stack.
Definition at line 92 of file EFreeList.h.