summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/server/BlockImpl.hpp10
-rw-r--r--src/server/events/Connect.cpp4
-rw-r--r--src/server/events/Disconnect.cpp18
3 files changed, 13 insertions, 19 deletions
diff --git a/src/server/BlockImpl.hpp b/src/server/BlockImpl.hpp
index 06111a88..773cb115 100644
--- a/src/server/BlockImpl.hpp
+++ b/src/server/BlockImpl.hpp
@@ -17,7 +17,7 @@
#ifndef INGEN_ENGINE_BLOCKIMPL_HPP
#define INGEN_ENGINE_BLOCKIMPL_HPP
-#include <list>
+#include <set>
#include <boost/intrusive/slist.hpp>
#include <boost/optional.hpp>
@@ -138,10 +138,10 @@ public:
virtual PortImpl* port_by_symbol(const char* symbol);
/** Blocks that are connected to this Block's inputs. */
- std::list<BlockImpl*>& providers() { return _providers; }
+ std::set<BlockImpl*>& providers() { return _providers; }
/** Blocks that are connected to this Block's outputs. */
- std::list<BlockImpl*>& dependants() { return _dependants; }
+ std::set<BlockImpl*>& dependants() { return _dependants; }
/** Flag block as polyphonic.
*
@@ -190,8 +190,8 @@ protected:
Raul::Array<PortImpl*>* _ports; ///< Access in audio thread only
Context::ID _context; ///< Context this block runs in
uint32_t _polyphony;
- std::list<BlockImpl*> _providers; ///< Blocks connected to this one's input ports
- std::list<BlockImpl*> _dependants; ///< Blocks this one's output ports are connected to
+ std::set<BlockImpl*> _providers; ///< Blocks connected to this one's input ports
+ std::set<BlockImpl*> _dependants; ///< Blocks this one's output ports are connected to
bool _polyphonic;
bool _activated;
bool _enabled;
diff --git a/src/server/events/Connect.cpp b/src/server/events/Connect.cpp
index 5eff8854..8880322d 100644
--- a/src/server/events/Connect.cpp
+++ b/src/server/events/Connect.cpp
@@ -111,8 +111,8 @@ Connect::pre_process()
provider...
*/
if (tail_block != head_block && tail_block->parent() == head_block->parent()) {
- head_block->providers().push_back(tail_block);
- tail_block->dependants().push_back(head_block);
+ head_block->providers().insert(tail_block);
+ tail_block->dependants().insert(head_block);
}
_graph->add_arc(_arc);
diff --git a/src/server/events/Disconnect.cpp b/src/server/events/Disconnect.cpp
index 5634e2c2..6f84dc1a 100644
--- a/src/server/events/Disconnect.cpp
+++ b/src/server/events/Disconnect.cpp
@@ -72,20 +72,14 @@ Disconnect::Impl::Impl(Engine& e,
BlockImpl* const tail_block = _tail->parent_block();
BlockImpl* const head_block = _head->parent_block();
- for (std::list<BlockImpl*>::iterator i = head_block->providers().begin();
- i != head_block->providers().end(); ++i) {
- if ((*i) == tail_block) {
- head_block->providers().erase(i);
- break;
- }
+ std::set<BlockImpl*>::iterator hp = head_block->providers().find(tail_block);
+ if (hp != head_block->providers().end()) {
+ head_block->providers().erase(hp);
}
- for (std::list<BlockImpl*>::iterator i = tail_block->dependants().begin();
- i != tail_block->dependants().end(); ++i) {
- if ((*i) == head_block) {
- tail_block->dependants().erase(i);
- break;
- }
+ std::set<BlockImpl*>::iterator td = tail_block->dependants().find(head_block);
+ if (td != tail_block->dependants().end()) {
+ tail_block->dependants().erase(td);
}
_head->decrement_num_arcs();