PixelLightAPI  .
Public Member Functions
PLCore::BinominalHeap< KeyType, ValueType, Comparer > Class Template Reference

Binominal heap. More...

#include <BinominalHeap.h>

Inheritance diagram for PLCore::BinominalHeap< KeyType, ValueType, Comparer >:
Inheritance graph
[legend]

List of all members.

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.

Detailed Description

template<class KeyType, class ValueType, class Comparer = CompareFunction>
class PLCore::BinominalHeap< KeyType, ValueType, Comparer >

Binominal heap.


Constructor & Destructor Documentation

template<class KeyType , class ValueType , class Comparer >
PLCore::BinominalHeap< KeyType, ValueType, Comparer >::BinominalHeap ( )
template<class KeyType , class ValueType , class Comparer >
PLCore::BinominalHeap< KeyType, ValueType, Comparer >::~BinominalHeap ( ) [virtual]

Destructor.


Member Function Documentation

template<class KeyType , class ValueType , class Comparer >
Iterator< ValueType > PLCore::BinominalHeap< KeyType, ValueType, Comparer >::GetIterator ( uint32  nIndex = 0) const [override, virtual]

Returns an iterator operating on the derived data structure.

Parameters:
[in]nIndexStart index, if >= 'total number of elements' the index is set to the last valid index
Returns:
Iterator operating on the derived

Implements PLCore::Iterable< ValueType >.

template<class KeyType , class ValueType , class Comparer >
ConstIterator< ValueType > PLCore::BinominalHeap< KeyType, ValueType, Comparer >::GetConstIterator ( uint32  nIndex = 0) const [override, virtual]

Returns a constant iterator operating on the derived data structure.

Parameters:
[in]nIndexStart index, if >= 'total number of elements' the index is set to the last valid index
Returns:
Constant iterator operating on the derived

Implements PLCore::Iterable< ValueType >.

template<class KeyType , class ValueType , class Comparer >
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.

Returns:
Iterator operating on the derived,
Remarks:
Use this function to get an iterator if you want to iterate in reversed order starting at the end last element.

Implements PLCore::Iterable< ValueType >.

template<class KeyType , class ValueType , class Comparer >
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.

Returns:
Constant iterator operating on the derived,
Remarks:
Use this function to get a constant iterator if you want to iterate in reversed order starting at the end last element.

Implements PLCore::Iterable< ValueType >.

template<class KeyType , class ValueType , class Comparer >
void PLCore::BinominalHeap< KeyType, ValueType, Comparer >::Clear ( ) [override, virtual]

Clears the heap.

Implements PLCore::Heap< KeyType, ValueType >.

template<class KeyType , class ValueType , class Comparer >
bool PLCore::BinominalHeap< KeyType, ValueType, Comparer >::IsEmpty ( ) const [override, virtual]

Checks whether the heap is complete empty.

Returns:
'true' if the heap is empty, else 'false'

Implements PLCore::Heap< KeyType, ValueType >.

template<class KeyType , class ValueType , class Comparer >
uint32 PLCore::BinominalHeap< KeyType, ValueType, Comparer >::GetNumOfElements ( ) const [override, virtual]

Returns the number of elements.

Returns:
Number of container elements

Implements PLCore::Heap< KeyType, ValueType >.

template<class KeyType , class ValueType , class Comparer >
bool PLCore::BinominalHeap< KeyType, ValueType, Comparer >::Add ( const KeyType &  Key,
const ValueType &  Value 
) [override, virtual]

Adds a new element to the heap.

Parameters:
[in]KeyThe key of the new element
[in]ValueThe value of the new element
Returns:
'true' if all went fine, else 'false'
Note:
  • You have to check by yourself whether there's already such a key within the heap

Implements PLCore::Heap< KeyType, ValueType >.

template<class KeyType , class ValueType , class Comparer >
bool PLCore::BinominalHeap< KeyType, ValueType, Comparer >::GetTop ( ValueType *  pValue = nullptr,
KeyType *  pKey = nullptr 
) const [override, virtual]

Returns the value of the top element.

Parameters:
[out]pValueIf not a null pointer, this will receive the value of the top element
[out]pKeyIf not a null pointer, this will receive the key of the top element
Returns:
'true' if all went fine, else 'false'

Implements PLCore::Heap< KeyType, ValueType >.

template<class KeyType , class ValueType , class Comparer >
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.

Parameters:
[out]pValueIf not a null pointer, this will receive the value of the top element
[out]pKeyIf not a null pointer, this will receive the key of the top element
Returns:
'true' if all went fine, else 'false'

Implements PLCore::Heap< KeyType, ValueType >.


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


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:09:24
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported