Aggie Student Toolkit — Load Balancer
CSCE 412 Project 4
Arnav Fotedar · Fall 2026 · C++ load balancer simulation
Toggle main menu visibility
Loading...
Searching...
No Matches
Request.h
Go to the documentation of this file.
1
6
7
#ifndef REQUEST_H
8
#define REQUEST_H
9
10
#include <string>
11
19
enum class
JobType
:
char
{
20
Processing
=
'P'
,
21
Streaming
=
'S'
22
};
23
29
inline
char
jobTypeCode
(
JobType
type) {
30
return
static_cast<
char
>
(type);
31
}
32
41
struct
Request
{
42
unsigned
long
id
= 0;
43
std::string
sourceIp
;
44
std::string
destinationIp
;
45
unsigned
int
taskCycles
= 1;
46
unsigned
long
arrivalCycle
= 0;
47
JobType
jobType
=
JobType::Processing
;
48
};
49
50
#endif
jobTypeCode
char jobTypeCode(JobType type)
Returns the one-letter code for a job type ('P' or 'S').
Definition
Request.h:29
JobType
JobType
Category of work carried by a Request.
Definition
Request.h:19
JobType::Processing
@ Processing
Short computational job, such as rendering a page or running a query.
Definition
Request.h:20
JobType::Streaming
@ Streaming
Long-lived transfer, such as streaming media or a large download.
Definition
Request.h:21
Request
A single web request waiting for, or receiving, service.
Definition
Request.h:41
Request::taskCycles
unsigned int taskCycles
Clock cycles of processing required (always at least 1).
Definition
Request.h:45
Request::arrivalCycle
unsigned long arrivalCycle
Clock cycle at which the request was generated.
Definition
Request.h:46
Request::jobType
JobType jobType
Processing ('P') or streaming ('S') work.
Definition
Request.h:47
Request::destinationIp
std::string destinationIp
IPv4 address the response is returned to.
Definition
Request.h:44
Request::sourceIp
std::string sourceIp
IPv4 address of the client sending the request.
Definition
Request.h:43
Request.h
Generated by
1.18.0