RTXI 3.0.0 The Real-Time eXperiment Interface Reference Manual |
#include <rt.hpp>
Public Member Functions | |
System (Event::Manager *em, RT::Connector *rtc) | |
System (const System &system)=delete | |
System & | operator= (const System &system)=delete |
System (System &&)=delete | |
System & | operator= (System &&)=delete |
~System () override | |
int64_t | getPeriod () |
std::vector< RT::Telemitry::Response > | getTelemitry () |
void | createTelemitryProcessor () |
void | receiveEvent (Event::Object *event) override |
Public Member Functions inherited from Event::Handler | |
Handler ()=default | |
Handler (const Handler &)=default | |
Handler (Handler &&)=delete | |
Handler & | operator= (const Handler &)=default |
Handler & | operator= (Handler &&)=delete |
virtual | ~Handler ()=default |
Manages the RTOS as well as all objects that require realtime execution.
The System class is responsible for providing the execution context, closed real-time loop, and connection processes. Instantiation of this class automatically creates the real-time thread, and sets up communication with the Event::Manager class. Note that this does not initiate the telemitry system, and this should be created separately. The only real way to manage the real-time thread is by sending events, which system is programmed to transform into commands it can understand internally. This is designed to prevent use of non-realtime concurrency primitives that can slow down the system.
| explicit |
| delete |
| delete |
| override |
void RT::System::createTelemitryProcessor | ( | ) |
Creates a worker thread that reads telemitry from real-time thread
The passing of messages to the real-time thread using RT::System::receiveEvent is not enough to change system state as the system itself should not interact directly with concurrency primitives. The solution is to create a thread that will read telemitry struct and wakeup any sleeping threads associated with the given internal command. Without this, any caller that sends events to the system class will block indefinitely.
Definition at line 318 of file rt.cpp.
int64_t RT::System::getPeriod | ( | ) |
std::vector< RT::Telemitry::Response > RT::System::getTelemitry | ( | ) |
Extracts telemitry from the system running in real-time
| overridevirtual |
Processes Event and sends appropriate command to real-time thread
This function not only processes the event object, but it also performs computations that do not need to be run in real-time. This offloads heavy computations such as topological sort of threads or allocation of resources to non-realtime threads and allows the real-time thread to run fast fast fast.
event | An Event::Object object for the system to process |
Implements Event::Handler.
Definition at line 538 of file rt.cpp.