EventLoop implementation which runs a Computational Graph. More...
#include <event_loop.h>
Public Member Functions | |
EventLoop (const nlohmann::json &graph_config, std::chrono::milliseconds timestep, std::chrono::milliseconds timestepThres, ComputationalGraph::ExecMode execMode=ComputationalGraph::ExecMode::ALL_NODES, bool ownGIL=true, bool spinROS=false) | |
Constructor. More... | |
~EventLoop () | |
![]() | |
virtual | ~EventLoopInterface ()=default |
EventLoopInterface ()=delete | |
EventLoopInterface (std::chrono::milliseconds timestep, std::chrono::milliseconds timestepThres) | |
Constructor. More... | |
virtual void | initialize () |
Initialize loop. More... | |
void | runLoopOnce (const std::chrono::time_point< std::chrono::steady_clock > &startTime) |
Run a single loop. More... | |
void | runLoop (std::chrono::milliseconds timeout) |
Run loop. More... | |
void | runLoopAsync (std::chrono::milliseconds timeout=std::chrono::milliseconds(0), bool doInit=false) |
Run loop in a thread. More... | |
void | stopLoop () |
Stop loop. More... | |
void | shutdown () |
Shutdown loop. More... | |
bool | isRunning () |
Returns true if the event loop is currently running, false otherwise. More... | |
void | waitForLoopEnd () |
Blocks execution until the loop reaches timeout. More... | |
Protected Member Functions | |
void | initializeCB () override |
Initialize loop. More... | |
void | runLoopCB () override |
Execute actions which must be performed every loop. More... | |
void | shutdownCB () override |
Shutdown loop. More... | |
![]() | |
bool | isRunningNotAsync () |
Internal isRunning function. More... | |
Additional Inherited Members | |
![]() | |
std::chrono::milliseconds | _timestep |
timestep of the event loop More... | |
std::chrono::milliseconds | _timestepThres |
allowed time deviation in event loop timestep execution before printing a warning message More... | |
std::chrono::milliseconds | _currentTime = std::chrono::milliseconds(0) |
current time clock More... | |
unsigned long | _iterations = 0L |
stores the number of times the loop has been run More... | |
EventLoop implementation which runs a Computational Graph.
EventLoop::EventLoop | ( | const nlohmann::json & | graph_config, |
std::chrono::milliseconds | timestep, | ||
std::chrono::milliseconds | timestepThres, | ||
ComputationalGraph::ExecMode | execMode = ComputationalGraph::ExecMode::ALL_NODES , |
||
bool | ownGIL = true , |
||
bool | spinROS = false |
||
) |
Constructor.
EventLoop::~EventLoop | ( | ) |
|
overrideprotectedvirtual |
Initialize loop.
Implements EventLoopInterface.
|
overrideprotectedvirtual |
Execute actions which must be performed every loop.
Implements EventLoopInterface.
|
overrideprotectedvirtual |
Shutdown loop.
Implements EventLoopInterface.