summaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-02-25 03:40:39 +0000
committerDavid Robillard <d@drobilla.net>2010-02-25 03:40:39 +0000
commite22984efe9b82ab006494aea93814a592cd44ece (patch)
treea9b1b317515b9fda4947d4fb9c2bc460e07b0c32 /src/common
parent5d87212114e2df68a086eeb55829a70bed0940d3 (diff)
downloadingen-e22984efe9b82ab006494aea93814a592cd44ece.tar.gz
ingen-e22984efe9b82ab006494aea93814a592cd44ece.tar.bz2
ingen-e22984efe9b82ab006494aea93814a592cd44ece.zip
Store patch connections in a map using a lexicographic <Port*,Port*> key for
fast (logarathmic) connection searching. Replaces all O(num_connections) searches with O(lg(num_connections)) searches. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2491 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/common')
-rw-r--r--src/common/interface/Patch.hpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/common/interface/Patch.hpp b/src/common/interface/Patch.hpp
index 0817d7c2..f46c1a6d 100644
--- a/src/common/interface/Patch.hpp
+++ b/src/common/interface/Patch.hpp
@@ -18,6 +18,7 @@
#ifndef INGEN_INTERFACE_PATCH_HPP
#define INGEN_INTERFACE_PATCH_HPP
+#include <map>
#include "raul/SharedPtr.hpp"
#include "raul/List.hpp"
#include "interface/Node.hpp"
@@ -35,7 +36,8 @@ class Connection;
class Patch : virtual public Node
{
public:
- typedef Raul::List< SharedPtr<Connection> > Connections;
+ typedef std::pair<const Port*, const Port*> ConnectionsKey;
+ typedef std::map< ConnectionsKey, SharedPtr<Connection> > Connections;
virtual const Connections& connections() const = 0;