Manages simulation loop. Runs physics and brain interface, and synchronizes them via Transfer Functions.
More...
#include <event_loop_interface.h>
|
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...
|
|
Manages simulation loop. Runs physics and brain interface, and synchronizes them via Transfer Functions.
◆ ~EventLoopInterface()
virtual EventLoopInterface::~EventLoopInterface |
( |
| ) |
|
|
virtualdefault |
◆ EventLoopInterface() [1/2]
EventLoopInterface::EventLoopInterface |
( |
| ) |
|
|
delete |
◆ EventLoopInterface() [2/2]
EventLoopInterface::EventLoopInterface |
( |
std::chrono::milliseconds |
timestep, |
|
|
std::chrono::milliseconds |
timestepThres |
|
) |
| |
◆ initialize()
void EventLoopInterface::initialize |
( |
| ) |
|
|
virtual |
◆ initializeCB()
virtual void EventLoopInterface::initializeCB |
( |
| ) |
|
|
protectedpure virtual |
◆ isRunning()
bool EventLoopInterface::isRunning |
( |
| ) |
|
Returns true if the event loop is currently running, false otherwise.
It is intended to be used together with runLoopAsync
◆ isRunningNotAsync()
bool EventLoopInterface::isRunningNotAsync |
( |
| ) |
|
|
protected |
Internal isRunning function.
It can be used from threads, even when runLoopAsync was not used
◆ runLoop()
void EventLoopInterface::runLoop |
( |
std::chrono::milliseconds |
timeout | ) |
|
◆ runLoopAsync()
void EventLoopInterface::runLoopAsync |
( |
std::chrono::milliseconds |
timeout = std::chrono::milliseconds(0) , |
|
|
bool |
doInit = false |
|
) |
| |
Run loop in a thread.
- Parameters
-
timeout | time in seconds the loop will be run for |
doInit | if true, Initialize is executed before runLoop, also in the same thread. This is useful in cases where initialize needs to interact with the main thread |
◆ runLoopCB()
virtual void EventLoopInterface::runLoopCB |
( |
| ) |
|
|
protectedpure virtual |
◆ runLoopOnce()
void EventLoopInterface::runLoopOnce |
( |
const std::chrono::time_point< std::chrono::steady_clock > & |
startTime | ) |
|
◆ shutdown()
void EventLoopInterface::shutdown |
( |
| ) |
|
◆ shutdownCB()
virtual void EventLoopInterface::shutdownCB |
( |
| ) |
|
|
protectedpure virtual |
◆ stopLoop()
void EventLoopInterface::stopLoop |
( |
| ) |
|
Stop loop.
It is intended to be used together with runLoopAsync
◆ waitForLoopEnd()
void EventLoopInterface::waitForLoopEnd |
( |
| ) |
|
Blocks execution until the loop reaches timeout.
It is intended to be used together with runLoopAsync
◆ _currentTime
std::chrono::milliseconds EventLoopInterface::_currentTime = std::chrono::milliseconds(0) |
|
protected |
◆ _iterations
unsigned long EventLoopInterface::_iterations = 0L |
|
protected |
stores the number of times the loop has been run
◆ _timestep
std::chrono::milliseconds EventLoopInterface::_timestep |
|
protected |
timestep of the event loop
◆ _timestepThres
std::chrono::milliseconds EventLoopInterface::_timestepThres |
|
protected |
allowed time deviation in event loop timestep execution before printing a warning message
The documentation for this class was generated from the following files: