MayaFlux 0.4.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 41 of file BufferPipeline.cpp.

46{
47 auto branch_pipeline = std::make_shared<BufferPipeline>();
48 if (m_scheduler) {
49 branch_pipeline->m_scheduler = m_scheduler;
50 }
51 branch_builder(*branch_pipeline);
52
53 m_branches.push_back({ .condition = std::move(condition),
54 .pipeline = std::move(branch_pipeline),
55 .synchronous = synchronous,
56 .samples_per_operation = samples_per_operation });
57
58 return *this;
59}
std::vector< BranchInfo > m_branches
Vruta::TaskScheduler * m_scheduler

References m_branches, and m_scheduler.