summaryrefslogtreecommitdiffstats
path: root/src/client/PatchModel.hpp
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/client/PatchModel.hpp
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/client/PatchModel.hpp')
-rw-r--r--src/client/PatchModel.hpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/client/PatchModel.hpp b/src/client/PatchModel.hpp
index 1590aa10..e3baa3eb 100644
--- a/src/client/PatchModel.hpp
+++ b/src/client/PatchModel.hpp
@@ -27,6 +27,9 @@
#include "ConnectionModel.hpp"
namespace Ingen {
+
+namespace Shared { class Port; }
+
namespace Client {
class ClientStore;
@@ -43,8 +46,8 @@ public:
const Connections& connections() const { return *_connections.get(); }
- SharedPtr<ConnectionModel> get_connection(const Raul::Path& src_port_path,
- const Raul::Path& dst_port_path) const;
+ SharedPtr<ConnectionModel> get_connection(const Shared::Port* src_port,
+ const Shared::Port* dst_port);
//uint32_t poly() const { return _poly; }
bool enabled() const;
@@ -85,7 +88,7 @@ private:
bool remove_child(SharedPtr<ObjectModel> c);
void add_connection(SharedPtr<ConnectionModel> cm);
- void remove_connection(const Raul::Path& src_port_path, const Raul::Path& dst_port_path);
+ void remove_connection(const Shared::Port* src_port, const Shared::Port* dst_port);
SharedPtr<Connections> _connections;
bool _editable;