TheAlgorithms/C++ 1.0.0
All the 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
using queue< ValueType >::value_type = ValueType |
|
inline |
|
inline |
removes the first element from the queue
std::invalid_argument | if queue is empty |
Definition at line 81 of file queue.hpp.
|
inline |
prints the queue into the std::cout
Definition at line 17 of file queue.hpp.
|
inline |
inserts a new item into the queue
Definition at line 54 of file queue.hpp.
|
inlineprivate |
throws an exception if queue is empty
std::invalid_argument | if queue is empty |
|
inline |
std::invalid_argument | if queue is empty |
|
inline |
|
inline |
converts the queue into the std::vector
|
private |