|
|
| | SignalToken () noexcept=default |
| | Default-initialized token.
|
| |
| | SignalToken (SignalSource< T > const *signal, std::optional< ValueType > last=std::nullopt) noexcept |
| | Initialize token.
|
| |
|
| SignalToken (SignalToken const &) noexcept=default |
| |
|
auto | operator= (SignalToken const &) noexcept -> SignalToken &=default |
| |
| | SignalToken (SignalToken &&other) noexcept |
| | Move-construct token, leaving other in an invalid state.
|
| |
| auto | operator= (SignalToken &&other) noexcept -> SignalToken & |
| | Move-assign token, leaving other in an invalid state.
|
| |
|
| constexpr auto | IsValid () const noexcept -> bool |
| |
| auto | Load () const noexcept -> ValueType |
| |
| constexpr auto | GetSource () const -> SignalSource< ValueType > const * |
| |
|
constexpr auto | GetLast () const noexcept -> ValueType |
| | Get last observed value.
|
| |
|
| constexpr void | SetLast (ValueType last) noexcept |
| | Set last observed value.
|
| |
| auto | Update () noexcept -> ValueType |
| |
|
(Note that these are not member symbols.)
|
| template<class T> |
| constexpr auto | operator== (SignalToken< T > const &lhs, SignalToken< T > const &rhs) noexcept -> bool |
| | Equality comparison.
|
| |
| template<class T> |
| constexpr auto | operator!= (SignalToken< T > const &lhs, SignalToken< T > const &rhs) noexcept -> bool |
| | Inequality comparison.
|
| |
|
| template<class T> |
| auto | Wait (SignalToken< T > &token) noexcept -> T |
| | Wait until signal source changes and return current value.
|
| |
| template<class T, class Predicate> |
| auto | Wait (SignalToken< T > &token, Predicate &&stop_waiting) noexcept -> T |
| | Wait with predicate.
|
| |
|
| template<class T> |
| auto | Wait (StatusTag, SignalToken< T > &token) noexcept -> Status< T > |
| | Wait until signal source changes and return current and previous values.
|
| |
| template<class T, class Predicate> |
| auto | Wait (StatusTag, SignalToken< T > &token, Predicate &&stop_waiting) noexcept -> Status< T > |
| | Wait with predicate.
|
| |
|
| template<class T> |
| auto | Wait (DifferenceTag, SignalToken< T > &token) noexcept -> T |
| | Wait until signal source changes and return difference (current - previous) value.
|
| |
| template<class T, class Predicate> |
| auto | Wait (DifferenceTag, SignalToken< T > &token, Predicate &&stop_waiting) noexcept -> T |
| | Wait until signal source changes and return difference (current - previous) value.
|
| |
|
Effects Load and compare each of the signals with previous value.
The first one to change will be recorded in the WaitAnyResult::index. Depending on the selected overload the result of WaitAnyResult::result is either the current, difference or the Status containing both previous and current value.
|
| template<class T1, class T2> |
| auto | WaitAny (SignalToken< T1 > &token1, SignalToken< T2 > &token2) noexcept -> WaitAnyResult< T1, T2 > |
| | Wait for either of two signals to change.
|
| |
| template<class T1, class T2> |
| auto | WaitAny (StatusTag, SignalToken< T1 > &token1, SignalToken< T2 > &token2) noexcept -> WaitAnyResult< Status< T1 >, Status< T2 > > |
| | Wait for either of two signals to change.
|
| |
| template<class T1, class T2> |
| auto | WaitAny (DifferenceTag, SignalToken< T1 > &token1, SignalToken< T2 > &token2) noexcept -> WaitAnyResult< T1, T2 > |
| | Wait for either of two signals to change.
|
| |
template<class T>
class ion::SignalToken< T >
Signal token that has an associated SignalSource and last known value.
A SignalToken is valid (IsValid() == true) if it is associated with a SignalSource.
Moving a SignalToken will leave the moved-from object invalid.
See Signals for example.
- Thread Safety
- thread-compatible