template<typename YI_PRIORITY_QUEUE_ITEM, class YI_PRIORITY_QUEUE_ALLOCATOR = std::allocator<std::pair<YI_PRIORITY_QUEUE_PRIORITY, YI_PRIORITY_QUEUE_ITEM> >>
class CYIPriorityQueue< YI_PRIORITY_QUEUE_ITEM, YI_PRIORITY_QUEUE_ALLOCATOR >
A container class which maintains a queue of items within defined YI_PRIORITY_QUEUE_PRIORITY priorities.
The queue remains in priority order through use of all modification functions provided. When multiple items are added of the same priority, the order is dictated by the method used to add each item.
Iterators and many common query functions are provided for convenience.
- See also
- CYIPriorityQueue::Enqueue
-
CYIPriorityQueue::Push
-
YI_PRIORITY_QUEUE_PRIORITY
|
| | CYIPriorityQueue () |
| |
| virtual | ~CYIPriorityQueue () |
| |
| iterator | Begin () |
| |
| const_iterator | Begin () const |
| |
| reverse_iterator | ReverseBegin () |
| |
| const_reverse_iterator | ReverseBegin () const |
| |
| iterator | End () |
| |
| const_iterator | End () const |
| |
| reverse_iterator | ReverseEnd () |
| |
| const_reverse_iterator | ReverseEnd () const |
| |
| int32_t | Count (YI_PRIORITY_QUEUE_PRIORITY ePriority) const |
| |
| int32_t | Count (const YI_PRIORITY_QUEUE_ITEM &item) const |
| |
| int32_t | Count (const YI_PRIORITY_QUEUE_ITEM &item, YI_PRIORITY_QUEUE_PRIORITY ePriority) const |
| |
| int32_t | Count () const |
| |
| bool | IsEmpty () const |
| |
| iterator | Find (YI_PRIORITY_QUEUE_PRIORITY ePriority) |
| |
| const_iterator | Find (YI_PRIORITY_QUEUE_PRIORITY ePriority) const |
| |
| iterator | Find (const YI_PRIORITY_QUEUE_ITEM &item) |
| |
| const_iterator | Find (const YI_PRIORITY_QUEUE_ITEM &item) const |
| |
| iterator | Find (const YI_PRIORITY_QUEUE_ITEM &item, YI_PRIORITY_QUEUE_PRIORITY ePriority) |
| |
| const_iterator | Find (const YI_PRIORITY_QUEUE_ITEM &item, YI_PRIORITY_QUEUE_PRIORITY ePriority) const |
| |
| template<class YI_PREDICATE > |
| iterator | Find (YI_PREDICATE predicate) |
| |
| template<class YI_PREDICATE > |
| const_iterator | Find (YI_PREDICATE predicate) const |
| |
| bool | Contains (YI_PRIORITY_QUEUE_PRIORITY ePriority) const |
| |
| bool | Contains (const YI_PRIORITY_QUEUE_ITEM &item) const |
| |
| bool | Contains (const YI_PRIORITY_QUEUE_ITEM &item, YI_PRIORITY_QUEUE_PRIORITY ePriority) const |
| |
| template<class YI_PREDICATE > |
| bool | Contains (YI_PREDICATE predicate) const |
| |
| YI_PRIORITY_QUEUE_ITEM & | Head () |
| |
| const YI_PRIORITY_QUEUE_ITEM & | Head () const |
| |
| void | Clear () |
| |
| YI_PRIORITY_QUEUE_ITEM | Dequeue () |
| |
| void | Enqueue (YI_PRIORITY_QUEUE_ITEM item, YI_PRIORITY_QUEUE_PRIORITY ePriority=YI_PRIORITY_QUEUE_DEFAULT) |
| |
| void | Push (YI_PRIORITY_QUEUE_ITEM item, YI_PRIORITY_QUEUE_PRIORITY ePriority=YI_PRIORITY_QUEUE_DEFAULT) |
| |
| iterator | Remove (iterator it) |
| |
| bool | Remove (YI_PRIORITY_QUEUE_PRIORITY ePriority) |
| |
| bool | Remove (const YI_PRIORITY_QUEUE_ITEM &item) |
| |
| bool | Remove (const YI_PRIORITY_QUEUE_ITEM &item, YI_PRIORITY_QUEUE_PRIORITY ePriority) |
| |
| void | RemoveAll (YI_PRIORITY_QUEUE_PRIORITY ePriority) |
| |
| void | RemoveAll (const YI_PRIORITY_QUEUE_ITEM &item) |
| |
| void | RemoveAll (const YI_PRIORITY_QUEUE_ITEM &item, YI_PRIORITY_QUEUE_PRIORITY ePriority) |
| |
| template<class YI_PREDICATE > |
| void | RemoveAll (YI_PREDICATE predicate) |
| |
| void | Merge (CYIPriorityQueue< YI_PRIORITY_QUEUE_ITEM, YI_PRIORITY_QUEUE_ALLOCATOR > &rOther) |
| |
| void | Swap (CYIPriorityQueue< YI_PRIORITY_QUEUE_ITEM, YI_PRIORITY_QUEUE_ALLOCATOR > &rOther) |
| |
template<typename YI_PRIORITY_QUEUE_ITEM, class YI_PRIORITY_QUEUE_ALLOCATOR = std::allocator<std::pair<YI_PRIORITY_QUEUE_PRIORITY, YI_PRIORITY_QUEUE_ITEM> >>
| void CYIPriorityQueue< YI_PRIORITY_QUEUE_ITEM, YI_PRIORITY_QUEUE_ALLOCATOR >::Clear |
( |
| ) |
|
|
inline |
Removes and destroys all elements in the queue, leaving it with a count of 0.
All iterators related to this queue are invalidated, except end iterators.
template<typename YI_PRIORITY_QUEUE_ITEM, class YI_PRIORITY_QUEUE_ALLOCATOR = std::allocator<std::pair<YI_PRIORITY_QUEUE_PRIORITY, YI_PRIORITY_QUEUE_ITEM> >>
| YI_PRIORITY_QUEUE_ITEM CYIPriorityQueue< YI_PRIORITY_QUEUE_ITEM, YI_PRIORITY_QUEUE_ALLOCATOR >::Dequeue |
( |
| ) |
|
|
inline |
Returns a copy of the first element in the queue, then removes and deletes the first element. The count of the queue is reduced by 1.
Iterators to the element removed are invalidated and all other iterators related to this queue remain valid.
template<typename YI_PRIORITY_QUEUE_ITEM, class YI_PRIORITY_QUEUE_ALLOCATOR = std::allocator<std::pair<YI_PRIORITY_QUEUE_PRIORITY, YI_PRIORITY_QUEUE_ITEM> >>
| void CYIPriorityQueue< YI_PRIORITY_QUEUE_ITEM, YI_PRIORITY_QUEUE_ALLOCATOR >::Merge |
( |
CYIPriorityQueue< YI_PRIORITY_QUEUE_ITEM, YI_PRIORITY_QUEUE_ALLOCATOR > & |
rOther | ) |
|
|
inline |
Transfers all elements from rOther into this queue in priority order. Elements of equivalent priority originating in this queue will appear before elements from rOther.
There is no effect if rOther is this queue.
All iterators related to this queue remain valid. Iterators refering to the elements transferred from rOther still refer to those elements but are now related to this queue.
template<typename YI_PRIORITY_QUEUE_ITEM, class YI_PRIORITY_QUEUE_ALLOCATOR = std::allocator<std::pair<YI_PRIORITY_QUEUE_PRIORITY, YI_PRIORITY_QUEUE_ITEM> >>
Removes a single element in the queue pointed to by it. Returns an iterator pointing to the element following the one removed.
If it is not a valid iterator for this queue the behaviour of this function is undefined.
Iterators to the element removed are invalidated and all other iterators related to this queue remain valid.
template<typename YI_PRIORITY_QUEUE_ITEM, class YI_PRIORITY_QUEUE_ALLOCATOR = std::allocator<std::pair<YI_PRIORITY_QUEUE_PRIORITY, YI_PRIORITY_QUEUE_ITEM> >>
| bool CYIPriorityQueue< YI_PRIORITY_QUEUE_ITEM, YI_PRIORITY_QUEUE_ALLOCATOR >::Remove |
( |
const YI_PRIORITY_QUEUE_ITEM & |
item | ) |
|
|
inline |
Removes the first element in the queue matching item. Returns true if an element was removed.
Iterators to the element removed are invalidated and all other iterators related to this queue remain valid.
template<typename YI_PRIORITY_QUEUE_ITEM, class YI_PRIORITY_QUEUE_ALLOCATOR = std::allocator<std::pair<YI_PRIORITY_QUEUE_PRIORITY, YI_PRIORITY_QUEUE_ITEM> >>
Removes the first element in the queue matching item with priority ePriority. Returns true if an element was removed.
Iterators to the element removed are invalidated and all other iterators related to this queue remain valid.
template<typename YI_PRIORITY_QUEUE_ITEM, class YI_PRIORITY_QUEUE_ALLOCATOR = std::allocator<std::pair<YI_PRIORITY_QUEUE_PRIORITY, YI_PRIORITY_QUEUE_ITEM> >>
| void CYIPriorityQueue< YI_PRIORITY_QUEUE_ITEM, YI_PRIORITY_QUEUE_ALLOCATOR >::RemoveAll |
( |
const YI_PRIORITY_QUEUE_ITEM & |
item | ) |
|
|
inline |
Removes all elements in the queue matching item.
Iterators to elements removed are invalidated and all other iterators related to this queue remain valid.
template<typename YI_PRIORITY_QUEUE_ITEM, class YI_PRIORITY_QUEUE_ALLOCATOR = std::allocator<std::pair<YI_PRIORITY_QUEUE_PRIORITY, YI_PRIORITY_QUEUE_ITEM> >>
template<class YI_PREDICATE >
| void CYIPriorityQueue< YI_PRIORITY_QUEUE_ITEM, YI_PRIORITY_QUEUE_ALLOCATOR >::RemoveAll |
( |
YI_PREDICATE |
predicate | ) |
|
|
inline |
Removes all elements in the queue for which predicate returns true.
Iterators to elements removed are invalidated and all other iterators related to this queue remain valid.
template<typename YI_PRIORITY_QUEUE_ITEM, class YI_PRIORITY_QUEUE_ALLOCATOR = std::allocator<std::pair<YI_PRIORITY_QUEUE_PRIORITY, YI_PRIORITY_QUEUE_ITEM> >>
| void CYIPriorityQueue< YI_PRIORITY_QUEUE_ITEM, YI_PRIORITY_QUEUE_ALLOCATOR >::Swap |
( |
CYIPriorityQueue< YI_PRIORITY_QUEUE_ITEM, YI_PRIORITY_QUEUE_ALLOCATOR > & |
rOther | ) |
|
|
inline |
Exchanges the content of this queue with the content of rOther.
All iterators related to both queues remain valid, but now refer to elements in the other queue. End iterators for both queues may be invalidated.