NetSim 1.0.0
An educational network simulation software for students
Loading...
Searching...
No Matches
Public Member Functions | List of all members
NetSim::HTTPStrategy Class Reference

Strategy class for handling HTTP packages. More...

#include <httpstrategy.h>

Inheritance diagram for NetSim::HTTPStrategy:
Inheritance graph
[legend]
Collaboration diagram for NetSim::HTTPStrategy:
Collaboration graph
[legend]

Public Member Functions

 HTTPStrategy ()=default
 Default constructor.
 
virtual ~HTTPStrategy ()=default
 Virtual destructor to ensure correct cleanup and facilitate polymorphism.
 
void handle (Package package, Host *host) const override
 Manages the HTTP package.
 
- Public Member Functions inherited from NetSim::IPackageStrategy
 IPackageStrategy ()=default
 Default constructor.
 
virtual ~IPackageStrategy ()=default
 Virtual destructor to ensure correct cleanup for derived classes.
 
virtual void handle (Package package, Host *host) const =0
 Abstract method for handling packages.
 

Detailed Description

Strategy class for handling HTTP packages.

The HTTPStrategy class offers specific behavior for processing HTTP packages within the networking simulation environment. By employing this strategy class, the HTTP package handling logic can be decoupled from the primary host procedures. This class derives from the IPackageStrategy interface.

Constructor & Destructor Documentation

◆ HTTPStrategy()

NetSim::HTTPStrategy::HTTPStrategy ( )
default

Default constructor.

Establishes a new instance of the HTTPStrategy class.

◆ ~HTTPStrategy()

virtual NetSim::HTTPStrategy::~HTTPStrategy ( )
virtualdefault

Virtual destructor to ensure correct cleanup and facilitate polymorphism.

Enables proper cleanup of derived strategy objects and promotes dynamic dispatch.

Member Function Documentation

◆ handle()

void HTTPStrategy::handle ( Package  package,
Host host 
) const
overridevirtual

Manages the HTTP package.

Parameters
packageThe HTTP package in consideration.
hostThe host context where the strategy is invoked.

This function embodies the specific behavior necessary for handling HTTP packages. It interprets the HTTP request, crafts a corresponding response, and dispatches it to the appropriate router.

Implements NetSim::IPackageStrategy.

Here is the call graph for this function:

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