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

◆ write() [8/16]

void MayaFlux::Portal::Forma::Bridge::write ( Layer &  layer,
const std::vector< std::shared_ptr< MappedState< float > > > &  states,
std::function< void(std::span< const float >)>  sink 
)

Route an ordered set of scalar states as one float range each frame.

The range order is exactly the order of states. This is a layer-owned route rather than an element-owned one: it does not consume an element id, replace a control's existing outbound bindings, or require a synthetic owner element. The task stops when layer stops.

Parameters
layerLayer whose lifetime owns the aggregate route.
statesNon-null scalar states to sample in range order.
sinkConsumer of the sampled range. The span is valid only for the duration of the call.

Definition at line 361 of file Bridge.cpp.

365{
366 std::vector<std::function<float()>> readers;
367 readers.reserve(states.size());
368 for (const auto& state : states) {
369 readers.emplace_back([state] {
370 return state->value;
371 });
372 }
373 write_aggregate(layer, std::move(readers), std::move(sink));
374}
void write_aggregate(Layer &layer, std::vector< std::function< float()> > readers, std::function< void(std::span< const float >)> sink)
Definition Bridge.cpp:473

References write_aggregate().

+ Here is the call graph for this function: