Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

CPriorityQueue< T, Container, Compare > Class Template Reference

A priority queue with an iterator. More...

#include <CPriorityQueue.h>

Inheritance diagram for CPriorityQueue< T, Container, Compare >:

Inheritance graph
[legend]
Collaboration diagram for CPriorityQueue< T, Container, Compare >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef Container::value_type value_type
typedef Container::size_type size_type
typedef Container::iterator iterator
typedef Container::const_iterator const_iterator
typedef Container container_type

Public Member Functions

 CPriorityQueue (Container &swappedIn)
manipulators
void push (const value_type &v)
 Add element.
void pop ()
 Remove head element.
void erase (iterator i)
 Erase element.
iterator begin ()
 Get start iterator.
iterator end ()
 Get end iterator.
void swap (CPriorityQueue< T, Container, Compare > &q)
 Swap contents with another priority queue.
void swap (Container &c2)
 Swap contents with another container.
accessors
bool empty () const
 Returns true if there are no elements.
size_type size () const
 Returns the number of elements.
const value_type & top () const
 Returns the head element.
const_iterator begin () const
 Get start iterator.
const_iterator end () const
 Get end iterator.

Detailed Description

template<class T, class Container = std::vector<T>, class Compare = std::greater<typename Container::value_type>>
class CPriorityQueue< T, Container, Compare >

A priority queue with an iterator.

This priority queue is the same as a standard priority queue except: it sorts by std::greater, it has a forward iterator through the elements (which can appear in any order), and its contents can be swapped.

Definition at line 34 of file CPriorityQueue.h.


The documentation for this class was generated from the following file:
Generated on Fri Nov 6 00:21:29 2009 for synergy-plus by  doxygen 1.3.9.1