NetSim 1.0.0
An educational network simulation software for students
|
Strategy class for handling DNS packages. More...
#include <dnsstrategy.h>
Public Member Functions | |
DNSStrategy ()=default | |
Default constructor. | |
virtual | ~DNSStrategy ()=default |
Virtual destructor for cleanup and to allow for polymorphism. | |
void | handle (Package package, Host *host) const override |
Handles the DNS 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 DNS packages.
The DNSStrategy class provides the specific behavior for handling DNS packages within the networking simulation. This strategy class allows for decoupling the DNS package handling logic from the main host logic. Inherits from the IPackageStrategy interface.
|
default |
Default constructor.
Initializes a new instance of the DNSStrategy class.
|
virtualdefault |
Virtual destructor for cleanup and to allow for polymorphism.
Ensures proper cleanup of derived strategy objects and supports dynamic dispatch.
Handles the DNS package.
package | The DNS package to handle. |
host | The host context from which the strategy is being invoked. |
This method provides the specific behavior for handling DNS packages. It processes the DNS request, generates a response, and forwards it to the appropriate router.
Implements NetSim::IPackageStrategy.