Access to a port that this reaction may write to. More...
#include <xronos/sdk/reaction.hh>
Public Member Functions | |
PortEffect (Port< T > &port, ReactionContext context) | |
Construct a new PortEffect object. | |
void | set (const ImmutableValuePtr< T > &value_ptr) |
Set the port value and send a message to connected ports. | |
void | set (MutableValuePtr< T > &&value_ptr) |
template<class U> requires (!std::is_same_v<U, void> && std::is_same_v<T, U>) | |
void | set (const U &value) |
template<class U> requires (!std::is_same_v<U, void> && std::is_same_v<T, U>) | |
void | set (U &&value) |
void | set () |
Set the port without sending any value to connected ports. | |
Access to a port that this reaction may write to.
T | The type of value carried by the port. |
xronos::sdk::BaseReaction::PortEffect< T >::PortEffect | ( | Port< T > & | port, |
ReactionContext | context ) |
Construct a new PortEffect
object.
port | An port of the containing reactor, which can be obtained using the Reaction::self method. |
context | The current reaction's initialization context, which can be obtained using the BaseReaction::context method. |
void xronos::sdk::BaseReaction::PortEffect< T >::set | ( | const ImmutableValuePtr< T > & | value_ptr | ) |
Set the port value and send a message to connected ports.
Can be called multiple times, but at each time at most one value is sent to connected ports. When called repeatedly at a given timestamp, the previous value is overwritten.
value_ptr | A pointer to the value to be written to the referenced port. |
void xronos::sdk::BaseReaction::PortEffect< T >::set | ( | MutableValuePtr< T > && | value_ptr | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void xronos::sdk::BaseReaction::PortEffect< T >::set | ( | const U & | value | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void xronos::sdk::BaseReaction::PortEffect< T >::set | ( | U && | value | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.