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

Interface for defining strategies to handle packages. More...

#include <ipackagestrategy.h>

Inheritance diagram for NetSim::IPackageStrategy:
Inheritance graph
[legend]

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ IPackageStrategy()

NetSim::IPackageStrategy::IPackageStrategy ( )
default

Default constructor.

Establishes a new instance of the IPackageStrategy interface.

◆ ~IPackageStrategy()

virtual NetSim::IPackageStrategy::~IPackageStrategy ( )
virtualdefault

Virtual destructor to ensure correct cleanup for derived classes.

Ensures that derived strategy objects are properly destroyed and promotes dynamic dispatch.

Member Function Documentation

◆ handle()

virtual void NetSim::IPackageStrategy::handle ( Package  package,
Host host 
) const
pure virtual

Abstract method for handling packages.

Parameters
packageThe package to be handled.
hostThe 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.

Here is the caller graph for this function:

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