NetSim 1.0.0
An educational network simulation software for students
|
Strategy class for handling HTTP packages. More...
#include <httpstrategy.h>
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. | |
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.
|
default |
Default constructor.
Establishes a new instance of the HTTPStrategy class.
|
virtualdefault |
Virtual destructor to ensure correct cleanup and facilitate polymorphism.
Enables proper cleanup of derived strategy objects and promotes dynamic dispatch.
Manages the HTTP package.
package | The HTTP package in consideration. |
host | The 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.