Load Balancer Simulator
CSCE 412 - Load Balancer Simulation Project
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Request Struct Reference

Represents a single network request with source/destination IPs, processing time, and job type. More...

#include <Request.h>

Public Member Functions

 Request (std::string ipIn, std::string ipOut, int time, char jobType)
 Constructs a Request with the given parameters. More...
 

Static Public Member Functions

static Request generateRandom (int minTime, int maxTime)
 Generates a random Request with random IPs and a random processing time. More...
 
static std::string generateRandomIP ()
 Generates a random IP address string in dotted-decimal format. More...
 

Public Attributes

std::string ipIn
 Source IP address of the request. More...
 
std::string ipOut
 Destination IP address for the response. More...
 
int time
 Processing time in clock cycles. More...
 
char jobType
 Job type: 'P' for processing, 'S' for streaming. More...
 

Detailed Description

Represents a single network request with source/destination IPs, processing time, and job type.

Definition at line 14 of file Request.h.

Constructor & Destructor Documentation

◆ Request()

Request::Request ( std::string  ipIn,
std::string  ipOut,
int  time,
char  jobType 
)

Constructs a Request with the given parameters.

Parameters
ipInSource IP address
ipOutDestination IP address
timeProcessing time in clock cycles
jobTypeJob type character ('P' or 'S')

Definition at line 9 of file Request.cpp.

Member Function Documentation

◆ generateRandom()

Request Request::generateRandom ( int  minTime,
int  maxTime 
)
static

Generates a random Request with random IPs and a random processing time.

Parameters
minTimeMinimum processing time
maxTimeMaximum processing time
Returns
A randomly generated Request

Definition at line 23 of file Request.cpp.

◆ generateRandomIP()

std::string Request::generateRandomIP ( )
static

Generates a random IP address string in dotted-decimal format.

Returns
A random IP address (e.g. "192.168.1.42")

Definition at line 16 of file Request.cpp.

Member Data Documentation

◆ ipIn

std::string Request::ipIn

Source IP address of the request.

Definition at line 15 of file Request.h.

◆ ipOut

std::string Request::ipOut

Destination IP address for the response.

Definition at line 16 of file Request.h.

◆ jobType

char Request::jobType

Job type: 'P' for processing, 'S' for streaming.

Definition at line 18 of file Request.h.

◆ time

int Request::time

Processing time in clock cycles.

Definition at line 17 of file Request.h.


The documentation for this struct was generated from the following files: