MayaFlux 0.1.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 53 of file AggregateBindingsProcessor.cpp.

56{
57 auto agg_it = m_aggregates.find(aggregate_name);
58 if (agg_it == m_aggregates.end()) {
60 "Attempted to remove node from non-existent aggregate '{}'", aggregate_name);
61 return;
62 }
63
64 auto& nodes = agg_it->second.nodes;
65 auto node_it = std::ranges::find(nodes, node);
66
67 if (node_it != nodes.end()) {
68 nodes.erase(node_it);
69 agg_it->second.staging_data.resize(nodes.size());
70
72 "Removed node from aggregate '{}' (remaining: {})",
73 aggregate_name, nodes.size());
74
75 if (nodes.empty()) {
76 m_aggregates.erase(agg_it);
78 "Removed empty aggregate '{}'", aggregate_name);
79 }
80 } else {
82 "Attempted to remove node not in aggregate '{}'", aggregate_name);
83 }
84}
#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.