A reaction's trigger, declared on an event source. More...
#include <xronos/sdk/reaction.hh>
Public Member Functions | |
| template<template< class > class Serializer> | |
| Trigger (const InputPort< T, Serializer > &trigger, const ReactionContext &context) | |
| Constructor. | |
| template<template< class > class Serializer> | |
| Trigger (const OutputPort< T, Serializer > &trigger, const ReactionContext &context) | |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| Trigger (const PeriodicTimer &trigger, const ReactionContext &context) | |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| Trigger (const PhysicalEvent< T > &trigger, const ReactionContext &context) | |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| Trigger (const ProgrammableTimer< T > &trigger, const ReactionContext &context) | |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| Trigger (const Shutdown &trigger, const ReactionContext &context) | |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| Trigger (const Startup &trigger, const ReactionContext &context) | |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| auto | get () const noexcept -> ValueView< T > requires(!std::is_same_v< T, void >) |
| Get a view of the current event's value. | |
| auto | is_present () const noexcept -> bool |
| Check if an event is currently present. | |
A reaction's trigger, declared on an event source.
Through it the handler tests whether an event is present and reads its value.
| T | The value type associated with events received on the triggering event source. |
| xronos::sdk::BaseReaction::Trigger< T >::Trigger | ( | const InputPort< T, Serializer > & | trigger, |
| const ReactionContext & | context ) |
Constructor.
Constructing a Trigger automatically registers the given event source as a trigger of the reaction, causing the reaction handler to run at every timestamp at which the event source emits an event.
|
nodiscardnoexcept |
|
nodiscardnoexcept |
Check if an event is currently present.