Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

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>

Public Member Functions

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

Protected Member Functions

void freeFreeList ()
 deletes all instances in the list More...
 

Protected Attributes

E * m_pTop
 Top of the stack. More...
 

Friends

class EFreeListTypes< E, next >
 

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 39 of file EFreeList.h.

Constructor & Destructor Documentation

◆ EFreeList()

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

Constructs a new freelist.

Definition at line 52 of file EFreeList.h.

◆ ~EFreeList()

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 55 of file EFreeList.h.

Member Function Documentation

◆ alloc()

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 58 of file EFreeList.h.

◆ empty()

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

Returns true if the stack is empty.

Definition at line 67 of file EFreeList.h.

◆ free()

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 70 of file EFreeList.h.

◆ freeFreeList()

template<typename E, E *E::* next>
void ogdf::EFreeList< E, next >::freeFreeList ( )
inlineprotected

deletes all instances in the list

Definition at line 74 of file EFreeList.h.

Friends And Related Function Documentation

◆ EFreeListTypes< E, next >

template<typename E, E *E::* next>
friend class EFreeListTypes< E, next >
friend

Definition at line 49 of file EFreeList.h.

Member Data Documentation

◆ m_pTop

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

Top of the stack.

Definition at line 80 of file EFreeList.h.


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