|
CoreComponents 3.0.0
A Modern C++ Toolkit
|
Priority queue data container. More...
#include <cc/PriorityQueue>
Public Types | |
| using | Item = T |
| Item type. | |
| using | Priority = P |
| Priority type. | |
Standard Iterators | |
| using | value_type = Item |
| Item value type. | |
| using | size_type = long |
| Type of the container capacity. | |
| using | const_iterator = Iterator<const PriorityQueue> |
| Readonly value iterator. | |
| using | const_reverse_iterator = ReverseIterator<const PriorityQueue> |
| Readonly reverse value iterator. | |
| const_iterator | begin () const |
| Return readonly iterator pointing to the first item (if any) | |
| const_iterator | cbegin () const |
| Return readonly iterator pointing to the first item (if any) | |
| const_iterator | end () const |
| Return readonly iterator pointing behind the last item | |
| const_iterator | cend () const |
| Return readonly iterator pointing behind the last item | |
| const_reverse_iterator | rbegin () const |
| Return readonly reverse iterator pointing to the last item (if any) | |
| const_reverse_iterator | crbegin () const |
| Return readonly reverse iterator pointing to the last item (if any) | |
| const_reverse_iterator | rend () const |
| Return reverse iterator pointing before the first item | |
| const_reverse_iterator | crend () const |
| Return reverse iterator pointing before the first item | |
Construction and Assignment | |
| PriorityQueue ()=default | |
| Construct an empty queue. | |
| PriorityQueue (const PriorityQueue &other)=default | |
| Construct a copy of other. | |
| PriorityQueue (std::initializer_list< Item > items) | |
| Construct with initial items. | |
Item Access | |
| long | count () const |
| Get the number of items stored in the priority queue. | |
| Item | at (Locator pos) const |
| Get item at position pos. | |
Priority-Queue Operations | |
| Locator | head () const |
| Get a locator pointing to the first item. | |
| Locator | tail () const |
| Get a locator pointing to the last item. | |
| void | pushBack (const Item &item, Priority priority=Priority{}) |
| Append item to the queue. | |
| void | popFront (Out< Item > item=None{}) |
| Remove and return the first of the highest priority items. | |
| void | operator<< (const Item &item) |
| Append item to the end of the queue. | |
| void | operator>> (Item &item) |
| Remove and return item from the front of the queue. | |
Comparism Operators | |
| template<class Other > | |
| bool | operator== (const Other &other) const |
| Equality operator. | |
Priority queue data container.
| T | Item type |
| P | Priority type |
| using Item = T |
Item type.
| using Priority = P |
Priority type.
| using value_type = Item |
Item value type.
| using size_type = long |
Type of the container capacity.
| using const_iterator = Iterator<const PriorityQueue> |
Readonly value iterator.
| using const_reverse_iterator = ReverseIterator<const PriorityQueue> |
Readonly reverse value iterator.
|
default |
Construct an empty queue.
|
default |
Construct a copy of other.
| PriorityQueue | ( | std::initializer_list< Item > | items | ) |
Construct with initial items.
| long count | ( | ) | const |
Get the number of items stored in the priority queue.
| Locator head | ( | ) | const |
Get a locator pointing to the first item.
| Locator tail | ( | ) | const |
Get a locator pointing to the last item.
| void pushBack | ( | const Item & | item, |
| Priority | priority = Priority{} ) |
Append item to the queue.
Remove and return the first of the highest priority items.
| void operator<< | ( | const Item & | item | ) |
Append item to the end of the queue.
| void operator>> | ( | Item & | item | ) |
Remove and return item from the front of the queue.
| const_iterator begin | ( | ) | const |
Return readonly iterator pointing to the first item (if any)
| const_iterator cbegin | ( | ) | const |
Return readonly iterator pointing to the first item (if any)
| const_iterator end | ( | ) | const |
Return readonly iterator pointing behind the last item
| const_iterator cend | ( | ) | const |
Return readonly iterator pointing behind the last item
| const_reverse_iterator rbegin | ( | ) | const |
Return readonly reverse iterator pointing to the last item (if any)
| const_reverse_iterator crbegin | ( | ) | const |
Return readonly reverse iterator pointing to the last item (if any)
| const_reverse_iterator rend | ( | ) | const |
Return reverse iterator pointing before the first item
| const_reverse_iterator crend | ( | ) | const |
Return reverse iterator pointing before the first item