CSCE 412 - Project 3 Load Balancer
Loading...
Searching...
No Matches
webserver.h
Go to the documentation of this file.
1
9#ifndef WEBSERVER_H
10#define WEBSERVER_H
11
12#include "request.h"
13
14 //all doxygen comments are generated with AI assistance
15
23class WebServer {
24public:
29 WebServer(char name);
30
36 void addRequest(Request req, int currTime); //implemented with the assistance of AI
37
43 bool isRequestDone(int currTime);
44
49 bool isIdle() const; //implemented with the assistance of AI
50
55 char getName() const;
56
61
66 int getProcessedRequestCount() const;
67
68private:
69 char serverName;
70 Request currentRequest;
71 int requestStartTime;
72 bool hasActiveRequest = false;
73 int processedRequestCount = 0;
74};
75
76#endif
A class to represent a network request.
Definition request.h:15
A class to represent a server that processes a request.
Definition webserver.h:23
WebServer(char name)
Constructs a WebServer with a specified name.
Definition webserver.cpp:11
bool isIdle() const
Checks if the server is currently idle.
Definition webserver.cpp:86
void incrementProcessedRequestCount()
Increments the count of processed requests.
Definition webserver.cpp:68
char getName() const
Gets the name of the server.
Definition webserver.cpp:95
bool isRequestDone(int currTime)
Checks if the current request is done processing.
Definition webserver.cpp:46
void addRequest(Request req, int currTime)
Adds a request to the server's queue.
Definition webserver.cpp:25
int getProcessedRequestCount() const
Gets the count of processed requests.
Definition webserver.cpp:77