OS
v1.7.5
Documentation
|
An object to subscribe FSM(Finite State Machine) objects to specific user-defined signals. More...
#include <fsm.hpp>
Public Member Functions | |
signalPublisher () | |
bool | subscribeToSignal (stateMachine &m, sm::signalID s) noexcept |
Subscribe state machine to a particular signal. | |
bool | subscribeToSignal (stateMachine &m, sm::signalIDType s) noexcept |
bool | unsubscribeFromSignal (stateMachine &m, sm::signalID s) noexcept |
Unsubscribe state machine from a particular signal. | |
bool | unsubscribeFromSignal (stateMachine &m, sm::signalIDType s) noexcept |
bool | sendSignal (sm::signalID sig, void *sData=nullptr, bool isUrgent=false) noexcept |
Sends a signal to all its subscribers. | |
bool | sendSignal (sm::signalIDType sig, void *sData=nullptr, bool isUrgent=false) noexcept |
An object to subscribe FSM(Finite State Machine) objects to specific user-defined signals.
This object provides a mechanism to decouple signal producers from the signal consumers, so state-machine objects interested in certain signals subscribe to one or more Signals".
qOS::sm::signalPublisher::signalPublisher | ( | ) |
|
noexcept |
Sends a signal to all its subscribers.
config.h
[in] | sig | The user-defined signal. |
[in] | sData | The data associated to the signal. |
[in] | isUrgent | If true, the signal will be sent to the front of the queue. (only if the there is a signal-queue available) |
true
if the provided signal was successfully delivered to the subscribers (if available), otherwise return false
. false
if there is a queue, and the signal cannot be inserted because it is full.
|
inlinenoexcept |
|
noexcept |
Subscribe state machine to a particular signal.
[in] | m | State-machine to be subscribed |
[in] | s | Signal ID to which the subscriber FSM wants to subscribe. |
true
on success, otherwise returns false
.
|
inlinenoexcept |
|
noexcept |
Unsubscribe state machine from a particular signal.
[in] | m | State-machine to be subscribed |
[in] | s | Signal ID to which the subscriber FSM wants to unsubscribe. |
true
on success, otherwise returns false
.
|
inlinenoexcept |