Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
|
#include <queue.hpp>
Public Types | |
using | value_type = ValueType |
Public Member Functions | |
void | display () const |
prints the queue into the std::cout | |
std::vector< value_type > | toVector () const |
converts the queue into the std::vector | |
bool | isEmptyQueue () const |
checks if the queue has no elements | |
void | enQueue (const value_type &item) |
inserts a new item into the queue | |
value_type | front () const |
void | deQueue () |
removes the first element from the queue | |
void | clear () |
removes all elements from the queue | |
Private Types | |
using | node_type = Node<ValueType> |
Private Member Functions | |
void | ensureNotEmpty () const |
throws an exception if queue is empty | |
Private Attributes | |
std::shared_ptr< node_type > | queueFront |
std::shared_ptr< node_type > | queueRear |
std::size_t | size = 0 |
Definition of the queue class
|
inline |
removes all elements from the queue
|
inline |
removes the first element from the queue
std::invalid_argument | if queue is empty |
|
inline |
|
inline |
inserts a new item into the queue
|
inlineprivate |
throws an exception if queue is empty
std::invalid_argument | if queue is empty |
|
inline |
std::invalid_argument | if queue is empty |
|
inline |
checks if the queue has no elements
|
inline |
converts the queue into the std::vector
|
private |
Pointer to the front of the queue
|
private |
Pointer to the rear of the queue