MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ pending()

template<typename T = double>
requires is_value<T>
std::optional< T > MayaFlux::ControlValue::pending ( )
inlinenodiscardnoexcept

The value to apply now as type T, or nullopt when nothing is due.

A value is returned once per change. A value set with another type than T returns nothing.

Definition at line 105 of file ControlValue.hpp.

106 {
107 if (!has_value() || m_width.load(std::memory_order_acquire) != width_of<T>()) {
108 return std::nullopt;
109 }
110 if (!m_dirty.exchange(false, std::memory_order_acq_rel)) {
111 return std::nullopt;
112 }
113 return from_lanes<T>(lanes_for<T>());
114 }
bool has_value() const noexcept
True once a value was given.
static constexpr uint8_t width_of() noexcept
static T from_lanes(const std::array< double, k_lanes > &lanes) noexcept
std::atomic< uint8_t > m_width
std::array< double, k_lanes > lanes_for() const noexcept
std::atomic< bool > m_dirty

References from_lanes(), has_value(), lanes_for(), m_dirty, m_width, and width_of().

Referenced by MayaFlux::Nodes::Network::Control::pending().

Here is the call graph for this function:
Here is the caller graph for this function: