|
Brumski's DSA Learning Project 1.3
For Learning Data Structures and Algorithms in C++
|
This is a template class that represents the queue data structure. More...
#include <queue_dsa.hpp>
Classes | |
| class | Node |
| This is a template class that represents a single element of a queue, and it will be called "Node". More... | |
Public Member Functions | |
| MyQueue ()=default | |
| Default Constructor. | |
| MyQueue (const MyQueue< T > &)=delete | |
| Deleted copy constructor. | |
| MyQueue (MyQueue< T > &&other)=default | |
| Default Move constructor. | |
| MyQueue & | operator= (const MyQueue< T > &)=delete |
| Deleted copy assignment operator. | |
| MyQueue & | operator= (MyQueue< T > &&other)=default |
| Default Move assignment operator. | |
| virtual MyQueue< T > & | push_back (const T &value) |
| Inserts a value at the end of the queue. | |
| virtual T | front_element () |
| Prints out the front element in the queue. | |
| virtual T | last_element () |
| Prints out the last element in the queue. | |
| virtual T | popFront () |
| Removes the first element in the queue. | |
| virtual bool | isEmpty () |
| Returns true if the queue is empty. | |
Private Attributes | |
| std::shared_ptr< Node< T > > | theFirst |
| Pointer to the first element of the queue. | |
| std::shared_ptr< Node< T > > | theRear |
| Pointer to the last element of the queue. | |
This is a template class that represents the queue data structure.
It can take any basic C++ data type. It uses the First In First Out (FIFO) principle.
Default Move constructor.
| other | - the object that you want to transfer ownership from |
Default Move assignment operator.
| other | - the object that you want to transfer ownership from |
Inserts a value at the end of the queue.
| value | - the value that you want to pass to the end of the queue |