NetDEM v1.0
Loading...
Searching...
No Matches
command.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "simulation.hpp"
4#include <nlohmann/json.hpp>
5
6namespace netdem {
7
21class Command {
22public:
24 nlohmann::json info;
25
28
39 Command(nlohmann::json const &info, Simulation *sim) : info(info), sim(sim) {}
40
46 virtual void Execute() = 0;
47
53 virtual ~Command() {}
54};
55
56} // namespace netdem
A base class for commands that can modify a simulation based on provided JSON information.
Definition command.hpp:21
Simulation * sim
A pointer to the simulation object.
Definition command.hpp:27
nlohmann::json info
The information associated with the command.
Definition command.hpp:24
virtual void Execute()=0
Executes the command on the simulation object.
Command(nlohmann::json const &info, Simulation *sim)
Constructs a new Command object with the given information and simulation object.
Definition command.hpp:39
virtual ~Command()
Destroys the Command object.
Definition command.hpp:53
Class for managing a DEM simulation.
Definition simulation.hpp:21
Definition bond_entry.hpp:7