Пример #1
0
 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);
     }
 }
Пример #2
0
    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);
    }
Пример #3
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);
 }
Пример #4
0
 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);
 }
Пример #5
0
    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);
    }
Пример #6
0
 bool empty(void) const
 {
     return child_nodes.empty();
 }
Пример #7
0
 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);
 }
Пример #8
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;
 }
Пример #9
0
 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);
 }