simulation_framework::core::SimRunner Class Reference
Last update: 16.07.2025Simulation runner with external control logic. More...
#include <sim_runner.h>


Public Member Functions | |
| ~SimRunner () | |
Destructor for SimRunner. | |
| SimRunner (std::unique_ptr< lifecycle::ISimulationInstance > sim_instance) | |
Constructs a SimRunner with a simulation instance. More... | |
| StateFeedback | Run () override |
Executes the simulation and changes the state to kRunning. More... | |
| StateFeedback | Pause () override |
| Pauses the simulation. More... | |
| StateFeedback | Resume () override |
| Resumes the simulation. More... | |
| StateFeedback | StepN (int n) override |
| Steps the simulation forward by a specified number of frames. More... | |
| StateFeedback | Stop () override |
| Stops the simulation immediately. More... | |
| StateFeedback | Terminate () override |
| Terminates the simulation. More... | |
| SimState | GetSimulationState () const |
| Retrieves the current state of the simulation. More... | |
| uint64_t | GetExecutedStepCount () const |
| Retrieves the number of executed simulation steps. More... | |
| void | RunOverSimulation () override |
| Runs the simulation until it ends without accepting further commands. | |
Public Member Functions inherited from simulation_framework::core::ISimRunner | |
| virtual | ~ISimRunner ()=default |
| Virtual destructor for proper cleanup of derived classes. | |
Detailed Description
Simulation runner with external control logic.
The SimRunner class implements the ISimRunner interface and provides methods to control the flow of a simulation, including starting, pausing, stepping, and terminating it. Internally, it delegates these operations to a SimRunnerImpl object.
- See also
- ISimRunner, lifecycle::ISimulationInstance
Constructor & Destructor Documentation
◆ SimRunner()
|
explicit |
Constructs a SimRunner with a simulation instance.
- Parameters
-
sim_instance A unique pointer to the simulation instance to control.
Member Function Documentation
◆ GetExecutedStepCount()
|
virtual |
Retrieves the number of executed simulation steps.
The step counter resets if the simulation is restarted.
- Returns
- The number of executed simulation steps.
Implements simulation_framework::core::ISimRunner.
◆ GetSimulationState()
|
virtual |
Retrieves the current state of the simulation.
- Returns
- The current simulation state as a
SimStateenum value.
Implements simulation_framework::core::ISimRunner.
◆ Pause()
|
overridevirtual |
Pauses the simulation.
If the simulation is in the kRunning state, it transitions to the kPaused state.
- Returns
- A
StateFeedbackobject containing the status of the pause operation.
Implements simulation_framework::core::ISimRunner.
◆ Resume()
|
overridevirtual |
Resumes the simulation.
The simulation state changes from kPaused back to kRunning.
- Returns
- A
StateFeedbackobject containing the status of the resume operation.
Implements simulation_framework::core::ISimRunner.
◆ Run()
|
overridevirtual |
Executes the simulation and changes the state to kRunning.
The simulation runs until the scenario ends unless paused or stopped by the user.
- Returns
- A
StateFeedbackobject containing execution status and error information, if any.
Implements simulation_framework::core::ISimRunner.
◆ StepN()
|
overridevirtual |
Steps the simulation forward by a specified number of frames.
- Parameters
-
n The number of simulation steps to execute.
- Returns
- A
StateFeedbackobject containing the status of the step operation.
Implements simulation_framework::core::ISimRunner.
◆ Stop()
|
overridevirtual |
Stops the simulation immediately.
The simulation state resets to kInitialized.
- Returns
- A
StateFeedbackobject containing the status of the stop operation.
Implements simulation_framework::core::ISimRunner.
◆ Terminate()
|
overridevirtual |
Terminates the simulation.
- Returns
- A
StateFeedbackobject containing the status of the termination operation.
Implements simulation_framework::core::ISimRunner.
The documentation for this class was generated from the following file:
Public Member Functions inherited from