NetSim 1.0.0
An educational network simulation software for students
|
Interface for defining strategies to handle packages. More...
#include <ipackagestrategy.h>
Public Member Functions | |
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. | |
Interface for defining strategies to handle packages.
The IPackageStrategy class establishes a contract for all package handling strategy implementations. Classes implementing this interface must provide a concrete implementation for the handle
method, thus defining their custom logic for processing packages within the networking simulation environment.
|
default |
Default constructor.
Establishes a new instance of the IPackageStrategy interface.
|
virtualdefault |
Virtual destructor to ensure correct cleanup for derived classes.
Ensures that derived strategy objects are properly destroyed and promotes dynamic dispatch.
Abstract method for handling packages.
package | The package to be handled. |
host | The context where the strategy will be invoked. |
Classes implementing this interface must provide a concrete method to define how the given package is to be processed within the provided host context.
Implemented in NetSim::DNSStrategy, NetSim::HTTPStrategy, NetSim::TCPClientConnectionCloseStrategy, NetSim::TCPClientHandshakeStrategy, NetSim::TCPServerConnectionCloseStrategy, and NetSim::TCPServerHandshakeStrategy.