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

◆ remove_node()

void MayaFlux::Buffers::AggregateBindingsProcessor::remove_node ( const std::string &  aggregate_name,
const std::shared_ptr< Nodes::Node > &  node 
)

Remove a node from an aggregate.

Parameters
aggregate_nameName of the aggregate group
nodeNode to remove

Definition at line 55 of file AggregateBindingsProcessor.cpp.

58{
59 auto agg_it = m_aggregates.find(aggregate_name);
60 if (agg_it == m_aggregates.end()) {
62 "Attempted to remove node from non-existent aggregate '{}'", aggregate_name);
63 return;
64 }
65
66 auto& nodes = agg_it->second.nodes;
67 auto node_it = std::ranges::find(nodes, node);
68
69 if (node_it != nodes.end()) {
70 nodes.erase(node_it);
71 agg_it->second.staging_data.resize(nodes.size());
72
74 "Removed node from aggregate '{}' (remaining: {})",
75 aggregate_name, nodes.size());
76
77 if (nodes.empty()) {
78 m_aggregates.erase(agg_it);
80 "Removed empty aggregate '{}'", aggregate_name);
81 }
82 } else {
84 "Attempted to remove node not in aggregate '{}'", aggregate_name);
85 }
86}
#define MF_WARN(comp, ctx,...)
#define MF_DEBUG(comp, ctx,...)
std::unordered_map< std::string, AggregateBinding > m_aggregates
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
@ Buffers
Buffers, Managers, processors and processing chains.

References MayaFlux::Journal::BufferProcessing, MayaFlux::Journal::Buffers, m_aggregates, MF_DEBUG, and MF_WARN.