CS::Utility::PriorityQueue< T, Container > Class Template Reference
An implementation of a priority queue. More...
#include <csutil/priorityqueue.h>
Public Member Functions | |
template<typename T2> | |
bool | Delete (const T2 &what) |
Remove largest item that is equal to what. | |
void | Insert (const T &what) |
Insert an item. | |
bool | IsEmpty () const |
Return whether items are still in the queue. | |
T | Pop () |
Return and remove the largest item. | |
const T & | Top () const |
Return, but don't remove, the largest item. |
Detailed Description
template<typename T, class Container = csArray<T>>
class CS::Utility::PriorityQueue< T, Container >
An implementation of a priority queue.
T must be comparable with csComparator<>. Larger items are returned first.
Definition at line 39 of file priorityqueue.h.
Member Function Documentation
template<typename T, class Container = csArray<T>>
template<typename T2>
bool CS::Utility::PriorityQueue< T, Container >::Delete | ( | const T2 & | what | ) | [inline] |
Remove largest item that is equal to what.
The contained type T and the type T2 of what must be comparable with csComparator<>.
- Returns:
- Whether item was found and deleted.
- Remarks:
- Does a linear search - slow.
Definition at line 135 of file priorityqueue.h.
template<typename T, class Container = csArray<T>>
void CS::Utility::PriorityQueue< T, Container >::Insert | ( | const T & | what | ) | [inline] |
template<typename T, class Container = csArray<T>>
bool CS::Utility::PriorityQueue< T, Container >::IsEmpty | ( | ) | const [inline] |
template<typename T, class Container = csArray<T>>
T CS::Utility::PriorityQueue< T, Container >::Pop | ( | ) | [inline] |
template<typename T, class Container = csArray<T>>
const T& CS::Utility::PriorityQueue< T, Container >::Top | ( | ) | const [inline] |
The documentation for this class was generated from the following file:
- csutil/priorityqueue.h
Generated for Crystal Space 1.2 by doxygen 1.4.7