|
wiRedPanda
Logic Circuit Simulator
|
RAII guard that stops the simulation on construction and restarts it on destruction. More...
#include <SimulationBlocker.h>
Public Member Functions | |
| SimulationBlocker (Simulation *simulation) | |
| Stops simulation if it was running and records whether to restart. | |
| ~SimulationBlocker () | |
| Restarts the simulation if it was running when this blocker was created. | |
RAII guard that stops the simulation on construction and restarts it on destruction.
Used to safely perform operations (e.g. loading a file, rebuilding the element map) that must not run while the simulation timer is active.
Example:
Definition at line 29 of file SimulationBlocker.h.
|
explicit |
Stops simulation if it was running and records whether to restart.
| simulation | Simulation to block. |
Definition at line 9 of file SimulationBlocker.cpp.
References qCDebug.
| SimulationBlocker::~SimulationBlocker | ( | ) |
Restarts the simulation if it was running when this blocker was created.
Definition at line 22 of file SimulationBlocker.cpp.
References qCDebug.