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