PixelLightAPI
.
|
Binominal heap. More...
#include <BinominalHeap.h>
Public Member Functions | |
BinominalHeap () | |
Constructor. | |
virtual | ~BinominalHeap () |
Destructor. | |
virtual Iterator< ValueType > | GetIterator (uint32 nIndex=0) const override |
Returns an iterator operating on the derived data structure. | |
virtual ConstIterator< ValueType > | GetConstIterator (uint32 nIndex=0) const override |
Returns a constant iterator operating on the derived data structure. | |
virtual Iterator< ValueType > | GetEndIterator () const override |
Returns an iterator operating on the derived data structure and starting at the end. | |
virtual ConstIterator< ValueType > | GetConstEndIterator () const override |
Returns a constant iterator operating on the derived data structure and starting at the end. | |
virtual void | Clear () override |
Clears the heap. | |
virtual bool | IsEmpty () const override |
Checks whether the heap is complete empty. | |
virtual uint32 | GetNumOfElements () const override |
Returns the number of elements. | |
virtual bool | Add (const KeyType &Key, const ValueType &Value) override |
Adds a new element to the heap. | |
virtual bool | GetTop (ValueType *pValue=nullptr, KeyType *pKey=nullptr) const override |
Returns the value of the top element. | |
virtual bool | ExtractTop (ValueType *pValue=nullptr, KeyType *pKey=nullptr) override |
Returns the value of the top element and removes it from the heap. |
Binominal heap.
PLCore::BinominalHeap< KeyType, ValueType, Comparer >::BinominalHeap | ( | ) |
PLCore::BinominalHeap< KeyType, ValueType, Comparer >::~BinominalHeap | ( | ) | [virtual] |
Destructor.
Iterator< ValueType > PLCore::BinominalHeap< KeyType, ValueType, Comparer >::GetIterator | ( | uint32 | nIndex = 0 | ) | const [override, virtual] |
Returns an iterator operating on the derived data structure.
[in] | nIndex | Start index, if >= 'total number of elements' the index is set to the last valid index |
Implements PLCore::Iterable< ValueType >.
ConstIterator< ValueType > PLCore::BinominalHeap< KeyType, ValueType, Comparer >::GetConstIterator | ( | uint32 | nIndex = 0 | ) | const [override, virtual] |
Returns a constant iterator operating on the derived data structure.
[in] | nIndex | Start index, if >= 'total number of elements' the index is set to the last valid index |
Implements PLCore::Iterable< ValueType >.
Iterator< ValueType > PLCore::BinominalHeap< KeyType, ValueType, Comparer >::GetEndIterator | ( | ) | const [override, virtual] |
Returns an iterator operating on the derived data structure and starting at the end.
Implements PLCore::Iterable< ValueType >.
ConstIterator< ValueType > PLCore::BinominalHeap< KeyType, ValueType, Comparer >::GetConstEndIterator | ( | ) | const [override, virtual] |
Returns a constant iterator operating on the derived data structure and starting at the end.
Implements PLCore::Iterable< ValueType >.
void PLCore::BinominalHeap< KeyType, ValueType, Comparer >::Clear | ( | ) | [override, virtual] |
Clears the heap.
Implements PLCore::Heap< KeyType, ValueType >.
bool PLCore::BinominalHeap< KeyType, ValueType, Comparer >::IsEmpty | ( | ) | const [override, virtual] |
Checks whether the heap is complete empty.
Implements PLCore::Heap< KeyType, ValueType >.
uint32 PLCore::BinominalHeap< KeyType, ValueType, Comparer >::GetNumOfElements | ( | ) | const [override, virtual] |
Returns the number of elements.
Implements PLCore::Heap< KeyType, ValueType >.
bool PLCore::BinominalHeap< KeyType, ValueType, Comparer >::Add | ( | const KeyType & | Key, |
const ValueType & | Value | ||
) | [override, virtual] |
Adds a new element to the heap.
[in] | Key | The key of the new element |
[in] | Value | The value of the new element |
Implements PLCore::Heap< KeyType, ValueType >.
bool PLCore::BinominalHeap< KeyType, ValueType, Comparer >::GetTop | ( | ValueType * | pValue = nullptr , |
KeyType * | pKey = nullptr |
||
) | const [override, virtual] |
Returns the value of the top element.
[out] | pValue | If not a null pointer, this will receive the value of the top element |
[out] | pKey | If not a null pointer, this will receive the key of the top element |
Implements PLCore::Heap< KeyType, ValueType >.
bool PLCore::BinominalHeap< KeyType, ValueType, Comparer >::ExtractTop | ( | ValueType * | pValue = nullptr , |
KeyType * | pKey = nullptr |
||
) | [override, virtual] |
Returns the value of the top element and removes it from the heap.
[out] | pValue | If not a null pointer, this will receive the value of the top element |
[out] | pKey | If not a null pointer, this will receive the key of the top element |
Implements PLCore::Heap< KeyType, ValueType >.
|