NetDEM v1.0
Loading...
Searching...
No Matches
netdem::Command Class Referenceabstract

A base class for commands that can modify a simulation based on provided JSON information. More...

#include <command.hpp>

Inheritance diagram for netdem::Command:
netdem::CommandCreate

Public Member Functions

 Command (nlohmann::json const &info, Simulation *sim)
 Constructs a new Command object with the given information and simulation object.
 
virtual void Execute ()=0
 Executes the command on the simulation object.
 
virtual ~Command ()
 Destroys the Command object.
 

Public Attributes

nlohmann::json info
 The information associated with the command.
 
Simulationsim
 A pointer to the simulation object.
 

Detailed Description

A base class for commands that can modify a simulation based on provided JSON information.

an interface that all commands would inheritage. A command modifies a simulation according to the provided json information.

The Command class is a base class for commands that can modify a simulation based on provided JSON information. It provides functionality to store information about the command and a pointer to the simulation object, as well as a virtual function to execute the command.

Constructor & Destructor Documentation

◆ Command()

netdem::Command::Command ( nlohmann::json const & info,
Simulation * sim )
inline

Constructs a new Command object with the given information and simulation object.

This constructor creates a new Command object with the given information and simulation object.

Parameters
infoThe information associated with the command.
simA pointer to the simulation object.

◆ ~Command()

virtual netdem::Command::~Command ( )
inlinevirtual

Destroys the Command object.

This virtual destructor destroys the Command object.

Member Function Documentation

◆ Execute()

virtual void netdem::Command::Execute ( )
pure virtual

Executes the command on the simulation object.

This virtual function executes the command on the simulation object.

Implemented in netdem::CommandCreate.

Member Data Documentation

◆ info

nlohmann::json netdem::Command::info

The information associated with the command.

◆ sim

Simulation* netdem::Command::sim

A pointer to the simulation object.


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