Load Balancer Simulator
CSCE 412 - Load Balancer Simulation Project
Request.h
Go to the documentation of this file.
1 
6 #ifndef REQUEST_H
7 #define REQUEST_H
8 
9 #include <string>
10 
14 struct Request {
15  std::string ipIn;
16  std::string ipOut;
17  int time;
18  char jobType;
19 
27  Request(std::string ipIn, std::string ipOut, int time, char jobType);
28 
35  static Request generateRandom(int minTime, int maxTime);
36 
41  static std::string generateRandomIP();
42 };
43 
44 #endif
Represents a single network request with source/destination IPs, processing time, and job type.
Definition: Request.h:14
static std::string generateRandomIP()
Generates a random IP address string in dotted-decimal format.
Definition: Request.cpp:16
int time
Processing time in clock cycles.
Definition: Request.h:17
static Request generateRandom(int minTime, int maxTime)
Generates a random Request with random IPs and a random processing time.
Definition: Request.cpp:23
Request(std::string ipIn, std::string ipOut, int time, char jobType)
Constructs a Request with the given parameters.
Definition: Request.cpp:9
std::string ipIn
Source IP address of the request.
Definition: Request.h:15
char jobType
Job type: 'P' for processing, 'S' for streaming.
Definition: Request.h:18
std::string ipOut
Destination IP address for the response.
Definition: Request.h:16