MayaFlux 1.0.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 5 of file BufferPipelineBranches.cpp.

10{
11 auto branch_pipeline = std::make_shared<BufferPipeline>();
12 if (m_scheduler) {
13 branch_pipeline->m_scheduler = m_scheduler;
14 }
15 branch_pipeline->m_buffer_manager = m_buffer_manager;
16 branch_pipeline->m_io_manager = m_io_manager;
17 branch_builder(*branch_pipeline);
18
19 m_branches.push_back({ .condition = std::move(condition),
20 .pipeline = std::move(branch_pipeline),
21 .synchronous = synchronous,
22 .samples_per_operation = samples_per_operation });
23
24 return *this;
25}
std::shared_ptr< IO::IOManager > m_io_manager
std::vector< BranchInfo > m_branches
std::shared_ptr< Buffers::BufferManager > m_buffer_manager
Vruta::TaskScheduler * m_scheduler

References m_branches, m_buffer_manager, m_io_manager, and m_scheduler.