CSCE 412 - Project 3 Load Balancer
Loading...
Searching...
No Matches
Request Class Reference

A class to represent a network request. More...

#include <request.h>

Public Member Functions

 Request ()
 Default constructor for Request.
 
 Request (const std::string &ip_in, const std::string &ip_out, int time, char type, int arrival)
 Parameterized constructor for Request.
 
std::string getIpIn () const
 Gets the input IP address of the request.
 
std::string getIpOut () const
 Gets the output IP address of the request.
 
int getProcessTime () const
 Gets the processing time of the request.
 
char getJobType () const
 Gets the job type of the request.
 
int getArrivalTime () const
 Gets the arrival time of the request.
 

Detailed Description

A class to represent a network request.

The Request class encapsulates the details of a network request, including the input and output IP addresses, processing time, job type, and arrival time.

Constructor & Destructor Documentation

◆ Request() [1/2]

Request::Request ( )

Default constructor for Request.

Initializes a Request object with default values.

Initializes a Request object with default values: empty IP addresses, a processing time of 0, an undefined job type, and an arrival time of 0.

◆ Request() [2/2]

Request::Request ( const std::string & ip_in,
const std::string & ip_out,
int time,
char type,
int arrival )

Parameterized constructor for Request.

Initializes a Request object with the specified input IP, output IP, processing time, job type, and arrival time.

Parameters
ip_inThe input IP address for the request.
ip_outThe output IP address for the request.
timeThe processing time for the request.
typeThe job type (character P for processing, S for streaming).
arrivalThe arrival time of the request.

Member Function Documentation

◆ getArrivalTime()

int Request::getArrivalTime ( ) const

Gets the arrival time of the request.

Returns
The arrival time as an integer.

◆ getIpIn()

std::string Request::getIpIn ( ) const

Gets the input IP address of the request.

Returns
The input IP address as a string.

◆ getIpOut()

std::string Request::getIpOut ( ) const

Gets the output IP address of the request.

Returns
The output IP address as a string.

◆ getJobType()

char Request::getJobType ( ) const

Gets the job type of the request.

Returns
The job type as a character.

◆ getProcessTime()

int Request::getProcessTime ( ) const

Gets the processing time of the request.

Returns
The processing time as an integer.

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