Allows a reaction to schedule future events using a ProgrammableTimer. More...
#include <xronos/sdk/reaction.hh>
Public Member Functions | |
ProgrammableTimerEffect (ProgrammableTimer< T > &timer, ReactionContext context) | |
Constructor. | |
void | schedule (const ImmutableValuePtr< T > &value_ptr, Duration delay=Duration::zero()) |
Schedule a future event. | |
void | schedule (MutableValuePtr< T > &&value_ptr, Duration delay=Duration::zero()) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<class U> requires (!std::is_same_v<U, void> && std::is_same_v<T, U>) | |
void | schedule (const U &value, Duration delay=Duration::zero()) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<class U> requires (!std::is_same_v<U, void> && std::is_same_v<T, U>) | |
void | schedule (U &&value, Duration delay=Duration::zero()) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | schedule (Duration delay=Duration::zero()) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. |
Allows a reaction to schedule future events using a ProgrammableTimer.
T | The value type associated with the programmable timer. |
xronos::sdk::BaseReaction::ProgrammableTimerEffect< T >::ProgrammableTimerEffect | ( | ProgrammableTimer< T > & | timer, |
ReactionContext | context ) |
Constructor.
timer | The ProgrammableTimer for which the reaction should have write access. |
context | The context of the reaction the effect is declared for. Can be obtained using context(). |
void xronos::sdk::BaseReaction::ProgrammableTimerEffect< T >::schedule | ( | const ImmutableValuePtr< T > & | value_ptr, |
Duration | delay = Duration::zero() ) |
Schedule a future event.
value_ptr | The value to be associated with the future event occurrence. |
delay | The time to wait until the new event is processed. |
void xronos::sdk::BaseReaction::ProgrammableTimerEffect< T >::schedule | ( | const U & | value, |
Duration | delay = Duration::zero() ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Copy constructs the value using the given lvalue reference.
void xronos::sdk::BaseReaction::ProgrammableTimerEffect< T >::schedule | ( | U && | value, |
Duration | delay = Duration::zero() ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Move constructs the value using the given rvalue reference.
void xronos::sdk::BaseReaction::ProgrammableTimerEffect< T >::schedule | ( | Duration | delay = Duration::zero() | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Schedule an event without an associated value. This is only available if T is void.