void apply_deep_on_children(functor const & f) { for (server_node_list::iterator it = child_nodes.begin(); it != child_nodes.end(); ++it) { if (it->is_group()) { abstract_group & grp = static_cast<abstract_group&>(*it); grp.apply_deep_on_children(f); } f(*it); } }
void free_synths_deep(void) { child_nodes.remove_and_dispose_if(std::mem_fn(&server_node::is_synth), std::mem_fn(&server_node::clear_parent)); /* now there are only group classes */ for(server_node_list::iterator it = child_nodes.begin(); it != child_nodes.end(); ++it) { abstract_group * group = static_cast<abstract_group*>(&*it); group->free_synths_deep(); } assert(child_synth_count == 0); }
server_node * previous_node(server_node * node) { assert(has_child(node)); server_node_list::iterator it = server_node_list::s_iterator_to(*node); if (unlikely(it == child_nodes.begin())) return nullptr; else return &(*--it); }
server_node * next_node(server_node * node) { assert(has_child(node)); server_node_list::iterator next = ++server_node_list::s_iterator_to(*node); if (unlikely(next == child_nodes.end())) return nullptr; else return &(*next); }
void free_synths_deep(void) { child_nodes.remove_and_dispose_if(std::mem_fn(&server_node::is_synth), std::mem_fn(&server_node::clear_parent)); /* now there are only group classes */ for(auto & elem : child_nodes) { abstract_group * group = static_cast<abstract_group*>(&elem); group->free_synths_deep(); } assert(child_synth_count == 0); }
bool empty(void) const { return child_nodes.empty(); }
void free_children(void) { child_nodes.clear_and_dispose(std::mem_fn(&server_node::clear_parent)); assert(child_synth_count == 0); assert(child_group_count == 0); }
std::size_t child_count(void) const { assert(child_group_count == child_groups.size()); assert(child_synth_count + child_group_count == child_nodes.size()); return child_synth_count + child_group_count; }
void apply_on_children(functor const & f) const { for (server_node_list::const_iterator it = child_nodes.begin(); it != child_nodes.end(); ++it) f(*it); }