-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequestqueue.h
More file actions
45 lines (38 loc) · 937 Bytes
/
Copy pathrequestqueue.h
File metadata and controls
45 lines (38 loc) · 937 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef REQUESTQUEUE_H
#define REQUESTQUEUE_H
#include <queue>
#include "request.h"
/**
* @brief Manages a queue of web requests.
*/
class RequestQueue {
public:
/**
* @brief Adds a request to the queue.
*
* @param request The request to be added.
*/
void enqueue(const Request& request);
/**
* @brief Removes and returns the request at the front of the queue.
*
* @return The request at the front of the queue.
* @throws std::out_of_range if the queue is empty.
*/
Request dequeue();
/**
* @brief Checks if the queue is empty.
*
* @return True if the queue is empty, false otherwise.
*/
bool isEmpty() const;
/**
* @brief Returns the number of requests in the queue.
*
* @return The number of requests in the queue.
*/
int size() const;
private:
std::queue<Request> queue;
};
#endif // REQUESTQUEUE_H