|
CoreComponents 3.0.0
A Modern C++ Toolkit
|
Double-ended queue data container. More...
#include <cc/Queue>
Public Types | |
| using | Item = T |
| Item type. | |
Standard Iterators | |
| using | value_type = Item |
| Item value type. | |
| using | size_type = long |
| Type of the container capacity. | |
| using | const_iterator = Iterator<const BucketChain<Item>> |
| Readonly value iterator. | |
| using | const_reverse_iterator = ReverseIterator<const BucketChain<Item>> |
| 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 | |
| Queue ()=default | |
| Construct an empty queue. | |
| Queue (const Queue &other)=default | |
| Construct a copy of other. | |
| Queue (std::initializer_list< Item > items) | |
| Construct with initial items. | |
| Queue (Queue &&other) | |
| Take over the right-side other. | |
| Queue & | operator= (const Queue &other)=default |
| Assign queue other. | |
| Queue & | operator= (Queue &&other) |
| Assign right-side queue other. | |
Item Access | |
| Locator | head () const |
| Get a locator pointing to the first item. | |
| Locator | tail () const |
| Get a locator pointing to the last item. | |
| long | count () const |
| Get the number of items stored in the queue. | |
| long | size () const |
| Get the number of items stored in the queue. | |
| long | operator+ () const |
| Get the number of items stored in the queue. | |
| const Item & | at (Locator pos) const |
| Get the constant reference to item at position pos. | |
| const Item & | first () const |
| Get constant reference to first item. | |
| const Item & | last () const |
| Get constant reference to last item. | |
| bool | first (const Item &item) const |
| Tell if item is the first item. | |
| bool | last (const Item &item) const |
| Tell if item is the last item. | |
Front and Back Operations | |
| template<class... Args> | |
| void | emplaceBack (Args... args) |
| Insert a new last item. | |
| template<class... Args> | |
| void | emplaceFront (Args... args) |
| Insert a new first item. | |
| void | pushBack (const Item &item) |
| Append item to the queue. | |
| void | pushFront (const Item &item) |
| Prepend item to the queue. | |
| void | popBack (Out< Item > item=None{}) |
| Remove and return the last item in the queue. | |
| void | popFront (Out< Item > item=None{}) |
| Remove and return the first item in the queue. | |
| 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. | |
Global Operations | |
| template<class F > | |
| void | forEach (F f) const |
| Call function f for each item. | |
| template<class Item > | |
| Array< Item > | toArray () const |
| Convert to an array or list. | |
| void | deplete () |
| Remove all items. | |
Comparism Operators | |
| template<class Other > | |
| bool | operator== (const Other &other) const |
| Equality operator. | |
| template<class Other > | |
| std::strong_ordering | operator<=> (const Other &other) const |
| Ordering operator. | |
Double-ended queue data container.
| T | Item type |
| using Item = T |
Item type.
| using value_type = Item |
Item value type.
| using size_type = long |
Type of the container capacity.
| using const_iterator = Iterator<const BucketChain<Item>> |
Readonly value iterator.
| using const_reverse_iterator = ReverseIterator<const BucketChain<Item>> |
Readonly reverse value iterator.
|
default |
Construct an empty queue.
| Locator head | ( | ) | const |
Get a locator pointing to the first item.
| Locator tail | ( | ) | const |
Get a locator pointing to the last item.
| long count | ( | ) | const |
Get the number of items stored in the queue.
| long size | ( | ) | const |
Get the number of items stored in the queue.
| long operator+ | ( | ) | const |
Get the number of items stored in the queue.
Get the constant reference to item at position pos.
| const Item & first | ( | ) | const |
Get constant reference to first item.
| const Item & last | ( | ) | const |
Get constant reference to last item.
| bool first | ( | const Item & | item | ) | const |
Tell if item is the first item.
| bool last | ( | const Item & | item | ) | const |
Tell if item is the last item.
| void emplaceBack | ( | Args... | args | ) |
Insert a new last item.
| args | construction arguments |
| void emplaceFront | ( | Args... | args | ) |
Insert a new first item.
| args | construction arguments |
| void pushBack | ( | const Item & | item | ) |
Append item to the queue.
| void pushFront | ( | const Item & | item | ) |
Prepend item to the queue.
Remove and return the last item in the queue.
Remove and return the first item in the queue.
| 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.
| void forEach | ( | F | f | ) | const |
Call function f for each item.
| F | Function type (lambda or functor) |
| f | Unary function which gets called for each item |
Convert to an array or list.
| Item | Target item type |
| void deplete | ( | ) |
Remove all items.
| 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
Equality operator.