xronos-sdk 0.5.0
Xronos C++ SDK
Loading...
Searching...
No Matches
xronos::sdk::BaseReaction::ProgrammableTimerEffect< T > Class Template Reference

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.

Detailed Description

template<class T>
class xronos::sdk::BaseReaction::ProgrammableTimerEffect< T >

Allows a reaction to schedule future events using a ProgrammableTimer.

Template Parameters
TThe value type associated with the programmable timer.

Constructor & Destructor Documentation

◆ ProgrammableTimerEffect()

template<class T>
xronos::sdk::BaseReaction::ProgrammableTimerEffect< T >::ProgrammableTimerEffect ( ProgrammableTimer< T > & timer,
ReactionContext context )

Constructor.

Parameters
timerThe ProgrammableTimer for which the reaction should have write access.
contextThe context of the reaction the effect is declared for. Can be obtained using context().

Member Function Documentation

◆ schedule() [1/4]

template<class T>
void xronos::sdk::BaseReaction::ProgrammableTimerEffect< T >::schedule ( const ImmutableValuePtr< T > & value_ptr,
Duration delay = Duration::zero() )

Schedule a future event.

Parameters
value_ptrThe value to be associated with the future event occurrence.
delayThe time to wait until the new event is processed.

◆ schedule() [2/4]

template<class T>
template<class U>
requires (!std::is_same_v<U, void> && std::is_same_v<T, U>)
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.

◆ schedule() [3/4]

template<class T>
template<class U>
requires (!std::is_same_v<U, void> && std::is_same_v<T, U>)
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.

◆ schedule() [4/4]

template<class T>
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.


The documentation for this class was generated from the following file: