Skip to content
Istvan Madari edited this page Oct 8, 2018 · 21 revisions

Component API

Message Handlers

Message handlers play central role in RIAPS applications. Message handlers are C++ functions and they called when a given type of message arrived to the ComponentBase. The name of the message handler is derived from the name of the port (defined in the RIAPS model file ❗ LINK ❗) where the message arrived. The naming convention for the message handler is: On{port_name}(...).

For example, if a component defines a subscriber port with tha name value and type ValueMsgType:

component C {
    sub value : ValueMsgType;
}

The C++ message handler will be:

virtual void OnValue(messages::ValueMsgType::Reader& msg, riaps::ports::PortBase* port) override;

RIAPS uses Cap'n Proto for serializing/deserializing messages. The ValueMsgType::Reader in the handler is a Cap'n Proto object. The PortBase pointer encapsulates the RIAPS port, where the message arrived.

Timers

Send/Recv Messages

Distributed Coordination

Group API

Leader Election

Consensus

Time-Synchronized Coordinated Action

Fault Management

Resource Management

Clone this wiki locally