Cade Royal CSCE 412 Project 3
Loading...
Searching...
No Matches
Queue.h
Go to the documentation of this file.
1
9#ifndef QUEUE_H
10#define QUEUE_H
11
12#include "Request.h"
13#include <queue>
14
24class Queue {
25public:
29 Queue();
30
34 ~Queue();
35
41 Queue(const Queue& other);
42
49 Queue& operator=(const Queue& other);
50
56 Queue(Queue&& other) noexcept = default;
57
64 Queue& operator=(Queue&& other) noexcept = default;
65
73 void enqueue(const Request& request);
74
84
90 bool isEmpty() const;
91
97 size_t size() const;
98
99private:
100 std::queue<Request> queue_;
101};
102
103#endif // QUEUE_H
104
Defines the Request class, representing a network request.
A class that represents a queue of Request objects.
Definition Queue.h:24
~Queue()
Destructor to clean up resources used by the Queue.
Definition Queue.cpp:27
Queue(Queue &&other) noexcept=default
Move constructor to transfer ownership of a Queue.
void enqueue(const Request &request)
Enqueue a Request into the queue.
Definition Queue.cpp:66
Request * dequeue()
Dequeue a Request from the queue.
Definition Queue.cpp:79
bool isEmpty() const
Check if the queue is empty.
Definition Queue.cpp:94
Queue()
Constructor to initialize an empty Queue.
Definition Queue.cpp:18
Queue & operator=(const Queue &other)
Copy assignment operator to assign a Queue.
Definition Queue.cpp:50
size_t size() const
Get the size of the queue.
Definition Queue.cpp:103
Queue & operator=(Queue &&other) noexcept=default
Move assignment operator to transfer ownership of a Queue.
A class to represent a network request.
Definition Request.h:25