|
GCSIM
|
implementation of the queue. More...
#include <queue.hpp>
Public Member Functions | |
| queue () | |
| creates the instance of the queue. | |
| ~queue () | |
| deletes the instance of the queue. | |
| queue (const queue &)=delete | |
| deleted copy constructor. | |
| queue & | operator= (const queue &)=delete |
| deleted assignment operator. | |
| queue (queue &&other) noexcept | |
| creates the instance of the queue from an existing queue. | |
| queue & | operator= (queue &&other) noexcept |
| assigns the instance of the queue from an existing queue. | |
| template<typename TT > requires std::is_constructible_v<T, TT&&> | |
| void | push (TT &&value) |
| enqueues an element at the end of the queue. | |
| T | pop () |
| pops the element from the front of the queue. | |
| T & | front () |
| peeks at the front element. | |
| const T & | front () const |
| peeks at the front element. | |
| bool | empty () const noexcept |
| checks if the queue is empty. | |
| size_t | get_size () const noexcept |
| getter for the size of the queue. | |
| void | clear () |
| clears all elements from the queue. | |
Private Types | |
| using | queue_entry = queue_entry< T > |
Private Attributes | |
| queue_entry * | head |
| pointer to the front of the queue. | |
| queue_entry * | tail |
| pointer to the back of the queue. | |
| size_t | size |
| size of the queue. | |
implementation of the queue.
| T | - type of the elements in the queue. |
|
private |
deletes the instance of the queue.
frees all the elements from the queue.
creates the instance of the queue from an existing queue.
| other | - rvalue of the existing queue. |
|
inline |
clears all elements from the queue.
|
inlinenoexcept |
checks if the queue is empty.
|
inline |
peeks at the front element.
| std::out_of_range | if queue is empty. |
|
inline |
peeks at the front element.
| std::out_of_range | if queue is empty. |
|
inlinenoexcept |
getter for the size of the queue.
deleted assignment operator.
assigns the instance of the queue from an existing queue.
| other | - rvalue of the existing queue. |
|
inline |
pops the element from the front of the queue.
| std::out_of_range | if queue is empty. |
|
inline |
enqueues an element at the end of the queue.
| TT | - type of the element. |
| value | - value of the element. |
|
private |
pointer to the front of the queue.
|
private |
size of the queue.
|
private |
pointer to the back of the queue.