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

◆ enable_mock_process()

void MayaFlux::Nodes::Generator::Generator::enable_mock_process ( bool  mock_process)
virtual

Allows RootNode to process the Generator without using the processed sample.

Parameters
bMock_processTrue to mock process, false to process normally

NOTE: This has no effect on the behaviour of process_sample (or process_batch). This is ONLY used by the RootNode when processing the node graph. If the output of the Generator needs to be ignored elsewhere, simply discard the return value.

Calling process manually can be cumbersome. Using a coroutine just to call process is overkill. This method allows the RootNode to process the Generator without using the processed sample, which is useful for mocking processing.

Definition at line 5 of file Generator.cpp.

6{
7 if (mock_process) {
9 } else {
11 }
12}
std::atomic< Utils::NodeState > m_state
Atomic state flag tracking the node's processing status.
Definition Node.hpp:463
void atomic_add_flag(std::atomic< Utils::NodeState > &state, Utils::NodeState flag)
Atomically adds a flag to a node state.
Definition NodeUtils.cpp:96
void atomic_remove_flag(std::atomic< Utils::NodeState > &state, Utils::NodeState flag)
Atomically removes a flag from a node state.
@ MOCK_PROCESS
Node should be processed but output ignored.
Definition Utils.hpp:33

References MayaFlux::Nodes::atomic_add_flag(), MayaFlux::Nodes::atomic_remove_flag(), MayaFlux::Nodes::Node::m_state, and MayaFlux::Utils::MOCK_PROCESS.

+ Here is the call graph for this function: