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

◆ read_state()

State MayaFlux::ControlValue::read_state ( ) const
inlinenodiscardprivatenoexcept

Definition at line 215 of file ControlValue.hpp.

216 {
217 return Memory::seqlock_read(m_lock, 0, [this] {
218 State state;
219 for (size_t index = 0; index < k_lanes; ++index) {
220 state.lanes[index] = m_lane[index].load(std::memory_order_relaxed);
221 }
222 state.width = m_width.load(std::memory_order_relaxed);
223 state.set = m_set.load(std::memory_order_relaxed);
224 return state;
225 }).value();
226 }
double value() const noexcept
The value as a double.
std::atomic< uint8_t > m_width
std::array< std::atomic< double >, k_lanes > m_lane
static constexpr size_t k_lanes
std::atomic< bool > m_set
auto seqlock_read(const Seqlock &lock, uint32_t max_attempts, Fn &&fn) -> std::optional< std::invoke_result_t< Fn > >
Invoke a read functor under a Seqlock with a bounded retry count.
Definition SeqLock.hpp:231

References k_lanes, MayaFlux::ControlValue::State::lanes, m_lane, m_lock, m_set, m_width, MayaFlux::Memory::seqlock_read(), MayaFlux::ControlValue::State::set, value(), and MayaFlux::ControlValue::State::width.

Referenced by lanes_for().

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