diff options
Diffstat (limited to 'src/libs/engine/PatchImpl.cpp')
-rw-r--r-- | src/libs/engine/PatchImpl.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/libs/engine/PatchImpl.cpp b/src/libs/engine/PatchImpl.cpp index 1625d1c3..2d33dd0d 100644 --- a/src/libs/engine/PatchImpl.cpp +++ b/src/libs/engine/PatchImpl.cpp @@ -289,12 +289,12 @@ PatchImpl::remove_node(const string& name) /** Remove a connection. - * Process thread only. + * Preprocessing thread only. */ PatchImpl::Connections::Node* PatchImpl::remove_connection(const PortImpl* src_port, const PortImpl* dst_port) { - assert(ThreadManager::current_thread_id() == THREAD_PROCESS); + assert(ThreadManager::current_thread_id() == THREAD_PRE_PROCESS); bool found = false; Connections::Node* connection = NULL; for (Connections::iterator i = _connections.begin(); i != _connections.end(); ++i) { @@ -311,6 +311,20 @@ PatchImpl::remove_connection(const PortImpl* src_port, const PortImpl* dst_port) return connection; } + + +bool +PatchImpl::has_connection(const PortImpl* src_port, const PortImpl* dst_port) const +{ + // FIXME: Doesn't scale + for (Connections::const_iterator i = _connections.begin(); i != _connections.end(); ++i) { + ConnectionImpl* const c = (ConnectionImpl*)i->get(); + if (c->src_port() == src_port && c->dst_port() == dst_port) + return true; + } + + return false; +} uint32_t |