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

Strategy class for handling DNS packages. More...

#include <dnsstrategy.h>

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

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ DNSStrategy()

NetSim::DNSStrategy::DNSStrategy ( )
default

Default constructor.

Initializes a new instance of the DNSStrategy class.

◆ ~DNSStrategy()

virtual NetSim::DNSStrategy::~DNSStrategy ( )
virtualdefault

Virtual destructor for cleanup and to allow for polymorphism.

Ensures proper cleanup of derived strategy objects and supports dynamic dispatch.

Member Function Documentation

◆ handle()

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

Handles the DNS package.

Parameters
packageThe DNS package to handle.
hostThe 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.

Here is the call graph for this function:

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