Common interface for all heap classes. More...
#include <ogdf/basic/heap/HeapBase.h>
Inheritance diagram for ogdf::HeapBase< IMPL, H, T, C >:Public Types | |
| using | Handle = H * |
| The type of handle used to identify stored values. | |
Public Member Functions | |
| HeapBase (const C &comp=C()) | |
| virtual const C & | comparator () const |
| Returns the comparator used to sort the values in the heap. | |
| virtual void | decrease (Handle handle, const T &value)=0 |
| Decreases a single value. | |
| virtual void | merge (IMPL &other) |
Merges in values of other heap. | |
| virtual void | pop ()=0 |
| Removes the topmost value from the heap. | |
| virtual Handle | push (const T &value)=0 |
| Inserts a value into the heap. | |
| virtual const T & | top () const =0 |
| Returns the topmost value in the heap. | |
| virtual const T & | value (const Handle handle) const =0 |
| Returns the value of that handle. | |
Private Attributes | |
| C | m_comp |
Common interface for all heap classes.
| IMPL | The type of heap. |
| H | The type of handle to use. Such a handle will be given to the user for each pushed value. |
| T | The type of values to be stored. |
| C | The comparator used to order the stored values. |
Definition at line 48 of file HeapBase.h.
| using ogdf::HeapBase< IMPL, H, T, C >::Handle = H* |
The type of handle used to identify stored values.
The handle type accessible from outside of the heap will always be a pointer.
Definition at line 56 of file HeapBase.h.
|
inlineexplicit |
Definition at line 58 of file HeapBase.h.
|
inlinevirtual |
Returns the comparator used to sort the values in the heap.
Definition at line 65 of file HeapBase.h.
|
pure virtual |
Decreases a single value.
| handle | The handle of the value to be decreased |
| value | The decreased value. This must be less than the former value |
|
virtual |
Merges in values of other heap.
After merge other heap becomes empty and is valid for further usage.
| other | A heap to be merged in. |
Definition at line 114 of file HeapBase.h.
|
pure virtual |
Removes the topmost value from the heap.
Implemented in ogdf::BinaryHeap< T, C >, ogdf::BinomialHeap< T, C >, ogdf::FibonacciHeap< T, C >, ogdf::PairingHeap< T, C >, and ogdf::RMHeap< T, C >.
|
pure virtual |
Inserts a value into the heap.
| value | The value to be inserted |
Implemented in ogdf::BinaryHeap< T, C >, ogdf::BinomialHeap< T, C >, ogdf::FibonacciHeap< T, C >, ogdf::PairingHeap< T, C >, and ogdf::RMHeap< T, C >.
|
pure virtual |
Returns the topmost value in the heap.
Implemented in ogdf::BinaryHeap< T, C >, ogdf::BinomialHeap< T, C >, ogdf::FibonacciHeap< T, C >, ogdf::PairingHeap< T, C >, and ogdf::RMHeap< T, C >.
|
pure virtual |
Returns the value of that handle.
| handle | The handle |
|
private |
Definition at line 49 of file HeapBase.h.