Template Class Heap

Inheritance Relationships

Base Type

  • private std::vector< HeapEntry >

Class Documentation

template<class HeapEntry, class HeapInterface>
class Heap : private std::vector<HeapEntry>

A class implementing a heap.

Public Types

typedef Heap<HeapEntry, HeapInterface> This

Public Functions

inline Heap()

Constructor.

inline Heap(const HeapInterface &i)

Construct with a given HeapInterface.

inline ~Heap()

Destructor.

inline void clear()

clear the heap

inline bool empty()

is heap empty?

inline unsigned int size()

returns the size of heap

inline void reserve(unsigned int n)

reserve space for N entries

inline void reset_heap_position(HeapEntry h)

reset heap position to -1 (not in heap)

inline bool is_stored(HeapEntry h)

is an entry in the heap?

inline void insert(HeapEntry h)

insert the entry h

inline HeapEntry front()

get the first entry

inline void pop_front()

delete the first entry

inline void remove(HeapEntry h)

remove an entry

inline void update(HeapEntry h)

update an entry: change the key and update the position to reestablish the heap property.

inline bool check()

Check heap condition.

Returns:

true if heap condition is satisfied, false if not.