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

◆ branch_if()

BufferPipeline & MayaFlux::Kriya::BufferPipeline::branch_if ( std::function< bool(uint32_t)>  condition,
const std::function< void(BufferPipeline &)> &  branch_builder,
bool  synchronous = false,
uint64_t  samples_per_operation = 1 
)

Add conditional branch to the pipeline.

Parameters
conditionFunction that determines if branch should execute
branch_builderFunction that configures the branch pipeline
synchronousIf true, branch executes within main cycle (default: false)
samples_per_operationNumber of samples per operation in branch (default: 1)
Returns
Reference to this pipeline for continued chaining

Definition at line 34 of file BufferPipeline.cpp.

39{
40 auto branch_pipeline = std::make_shared<BufferPipeline>();
41 if (m_scheduler) {
42 branch_pipeline->m_scheduler = m_scheduler;
43 }
44 branch_builder(*branch_pipeline);
45
46 m_branches.push_back({ std::move(condition),
47 std::move(branch_pipeline),
48 synchronous,
49 samples_per_operation });
50
51 return *this;
52}
std::vector< BranchInfo > m_branches
Vruta::TaskScheduler * m_scheduler

References m_branches, and m_scheduler.