RTXI  3.0.0
The Real-Time eXperiment Interface Reference Manual
Data Structures | Public Member Functions
RT::System Class Reference

#include <rt.hpp>

Inheritance diagram for RT::System:
Inheritance graph
Collaboration diagram for RT::System:
Collaboration graph

Public Member Functions

 System (Event::Manager *em, RT::Connector *rtc)
 System (const System &system)=delete
Systemoperator= (const System &system)=delete
 System (System &&)=delete
Systemoperator= (System &&)=delete
 ~System () override
int64_t getPeriod ()
std::vector< RT::Telemitry::ResponsegetTelemitry ()
void createTelemitryProcessor ()
void receiveEvent (Event::Object *event) override
- Public Member Functions inherited from Event::Handler
 Handler ()=default
 Handler (const Handler &)=default
 Handler (Handler &&)=delete
Handleroperator= (const Handler &)=default
Handleroperator= (Handler &&)=delete
virtual ~Handler ()=default

Detailed Description

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.

Definition at line 409 of file rt.hpp.

Constructor & Destructor Documentation

◆ System() [1/3]


Definition at line 274 of file rt.cpp.

Here is the call graph for this function:

◆ System() [2/3]

RT::System::System(const Systemsystem)

◆ System() [3/3]

RT::System::System(System && )

◆ ~System()


Definition at line 296 of file rt.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ createTelemitryProcessor()

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.

See also

Definition at line 318 of file rt.cpp.

Here is the call graph for this function:

◆ getPeriod()

int64_t RT::System::getPeriod()

Obtain the real-time period (in nanoseconds) of the system

ThePeriod of the system in nanoseconds

Definition at line 308 of file rt.cpp.

◆ getTelemitry()

std::vector< RT::Telemitry::Response > RT::System::getTelemitry()

Extracts telemitry from the system running in real-time

A vector of RT::Telemitry::Response structs

Definition at line 344 of file rt.cpp.

◆ operator=() [1/2]

System& RT::System::operator=(const Systemsystem)

◆ operator=() [2/2]

System& RT::System::operator=(System && )

◆ receiveEvent()

void RT::System::receiveEvent(Event::Objectevent)

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.

eventAn Event::Object object for the system to process
See also

Implements Event::Handler.

Definition at line 538 of file rt.cpp.

Here is the call graph for this function:

The documentation for this class was generated from the following files: