2#ifndef DATA_STRUCTURES_QUEUE_HPP_
3#define DATA_STRUCTURES_QUEUE_HPP_
8template <
class ValueType>
13 using value_type = ValueType;
18 std::cout <<
"Front --> ";
21 std::cout <<
"Size of queue: " << size <<
'\n';
30 return push_all_to_vector(this->
queueFront.get(), this->size);
40 throw std::invalid_argument(
"Queue is empty.");
55 auto newNode = std::make_shared<node_type>();
57 newNode->next =
nullptr;
101 std::size_t size = 0;
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 clear()
removes all elements from the queue
std::shared_ptr< node_type > queueRear
void ensureNotEmpty() const
throws an exception if queue is empty
void enQueue(const value_type &item)
inserts a new item into the queue
void deQueue()
removes the first element from the queue
std::shared_ptr< node_type > queueFront
Provides Node class and related utilities.