|
CSCE 412 - Project 3 Load Balancer
|
A class to represent a queue of requests. More...
#include <requestqueue.h>
Public Member Functions | |
| void | addRequest (const Request &r) |
| Adds a request to the queue. | |
| Request | getRequest () |
| Retrieves and removes a request from the queue. | |
| bool | isEmpty () const |
| Checks if the queue is empty. | |
| size_t | size () const |
| Gets the current size of the queue. | |
A class to represent a queue of requests.
The RequestQueue class manages a queue of Request objects, allowing requests to be added, retrieved, and checked for size and emptiness.
| void RequestQueue::addRequest | ( | const Request & | r | ) |
Adds a request to the queue.
This method inserts the specified request into the queue for later processing.
| r | The request to be added to the queue. |
| Request RequestQueue::getRequest | ( | ) |
Retrieves and removes a request from the queue.
This method returns the front request from the queue and removes it from the queue.
This method returns the front request from the queue and removes it from the queue. If the queue is empty, it returns a default-constructed Request object.
| bool RequestQueue::isEmpty | ( | ) | const |
Checks if the queue is empty.
This method determines whether the queue contains any requests.
| size_t RequestQueue::size | ( | ) | const |
Gets the current size of the queue.
This method returns the number of requests currently in the queue.