|
Cade Royal CSCE 412 Project 3
|
A class that represents a queue of Request objects. More...
#include <Queue.h>
Public Member Functions | |
| Queue () | |
| Constructor to initialize an empty Queue. | |
| ~Queue () | |
| Destructor to clean up resources used by the Queue. | |
| Queue (const Queue &other) | |
| Copy constructor to create a copy of a Queue. | |
| Queue & | operator= (const Queue &other) |
| Copy assignment operator to assign a Queue. | |
| Queue (Queue &&other) noexcept=default | |
| Move constructor to transfer ownership of a Queue. | |
| Queue & | operator= (Queue &&other) noexcept=default |
| Move assignment operator to transfer ownership of a Queue. | |
| void | enqueue (const Request &request) |
| Enqueue a Request into the queue. | |
| Request * | dequeue () |
| Dequeue a Request from the queue. | |
| bool | isEmpty () const |
| Check if the queue is empty. | |
| size_t | size () const |
| Get the size of the queue. | |
A class that represents a queue of Request objects.
The Queue class provides methods to manage a collection of Request objects, ensuring First-In-First-Out (FIFO) ordering. It allows adding (enqueueing) and removing (dequeuing) requests, and offers utility functions to check if the queue is empty and to get its size.
| Queue::Queue | ( | ) |
| Queue::~Queue | ( | ) |
| Queue::Queue | ( | const Queue & | other | ) |
|
defaultnoexcept |
| Request * Queue::dequeue | ( | ) |
Dequeue a Request from the queue.
Removes and returns the front Request object from the queue.
This method removes and returns a pointer to the Request at the front of the queue. If the queue is empty, it returns nullptr.
This function removes the front Request from the queue and returns a pointer to the dequeued Request. If the queue is empty, it returns nullptr.
| void Queue::enqueue | ( | const Request & | request | ) |
| bool Queue::isEmpty | ( | ) | const |
Check if the queue is empty.
Checks if the queue is empty.
Copy assignment operator to assign a Queue.
Copy assignment operator for Queue.
| other | The Queue object to assign. |
Assigns the contents of another Queue object to this Queue object.
| other | The Queue object to copy. |
| size_t Queue::size | ( | ) | const |