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

◆ atomic_add_flag()

void MayaFlux::Nodes::atomic_add_flag ( std::atomic< Utils::NodeState > &  state,
Utils::NodeState  flag 
)

Atomically adds a flag to a node state.

Parameters
stateThe atomic node state to modify
flagThe flag to add to the state

Adds a specific state flag to a node's state without affecting other state flags. This is used to mark nodes with specific conditions (like PROCESSED or ACTIVE) while preserving other aspects of the node's current state.

Definition at line 96 of file NodeUtils.cpp.

97{
98 auto current = state.load();
99 Utils::NodeState desired;
100 do {
101 desired = static_cast<Utils::NodeState>(current | flag);
102 } while (!state.compare_exchange_weak(current, desired,
103 std::memory_order_acq_rel,
104 std::memory_order_acquire));
105}

Referenced by MayaFlux::Nodes::Generator::Generator::enable_mock_process(), MayaFlux::Nodes::RootNode::process_frame(), MayaFlux::Nodes::RootNode::process_sample(), MayaFlux::Nodes::Filters::FIR::process_sample(), MayaFlux::Nodes::Filters::IIR::process_sample(), MayaFlux::Nodes::Generator::Impulse::process_sample(), MayaFlux::Nodes::Generator::Logic::process_sample(), MayaFlux::Nodes::Generator::Phasor::process_sample(), MayaFlux::Nodes::Generator::Polynomial::process_sample(), MayaFlux::Nodes::Generator::Sine::process_sample(), MayaFlux::Nodes::ChainNode::process_sample(), MayaFlux::Nodes::BinaryOpNode::process_sample(), MayaFlux::Buffers::FilterProcessor::process_single_sample(), MayaFlux::Nodes::RootNode::register_node(), and MayaFlux::Nodes::RootNode::unregister_node().

+ Here is the caller graph for this function: