template<class priority_t,class element_t,class hash_func=id<element_t> > class adevs_pqueue

A priority queue, implemented as a binary heap.

Public Methods

[more] adevs_pqueue()
Creates a heap with initial capacity and incremental growth value
[more] adevs_pqueue(int capacity, int grow = PQUEUE_DEFAULT_GROW)
[more] adevs_pqueue(const adevs_pqueue<priority_t, element_t, hash_func>& src)
[more]const adevs_pqueue<priority_t,element_t,hash_func> & operator=(const adevs_pqueue<priority_t, element_t, hash_func>& src)
[more]void insert(const element_t& e, const priority_t& priority)
Inserts a new item into the queue.
[more]void remove(const element_t& e)
Removes an arbitrary element from the queue
[more]const element_t& getMinimum()
Get the element at the front of the queue
[more]void removeMinimum()
Removes the element at the front of the queue
[more]bool isEnqueued(const element_t& e)
Returns true if the item has been enqueued, false otherwise
[more]const priority_t& minPriority()
Returns the minimum priority.
[more]int getSize() const
Returns the number of items in the queue
[more]void clear()
Removes all items in the queue
[more] ~adevs_pqueue()
Destructor


Documentation

A priority queue, implemented as a binary heap. Priority comparison use the <, >, >=, <=, and == operators. Elements are sorted with the smallest at the top. Priority types and elements types should support the assignment operator. A hashing function must also be provided for the element types (default is to use the id() function).
o adevs_pqueue()
Creates a heap with initial capacity and incremental growth value

o adevs_pqueue(int capacity, int grow = PQUEUE_DEFAULT_GROW)

o adevs_pqueue(const adevs_pqueue<priority_t, element_t, hash_func>& src)

oconst adevs_pqueue<priority_t,element_t,hash_func> & operator=(const adevs_pqueue<priority_t, element_t, hash_func>& src)

ovoid insert(const element_t& e, const priority_t& priority)
Inserts a new item into the queue. If the item is already in the queue, the item is reprioritized.

ovoid remove(const element_t& e)
Removes an arbitrary element from the queue

oconst element_t& getMinimum()
Get the element at the front of the queue

ovoid removeMinimum()
Removes the element at the front of the queue

obool isEnqueued(const element_t& e)
Returns true if the item has been enqueued, false otherwise

oconst priority_t& minPriority()
Returns the minimum priority.

oint getSize() const
Returns the number of items in the queue

ovoid clear()
Removes all items in the queue

o ~adevs_pqueue()
Destructor


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.