From e22984efe9b82ab006494aea93814a592cd44ece Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 25 Feb 2010 03:40:39 +0000 Subject: Store patch connections in a map using a lexicographic 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 --- src/client/PatchModel.hpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/client/PatchModel.hpp') 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 get_connection(const Raul::Path& src_port_path, - const Raul::Path& dst_port_path) const; + SharedPtr 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 c); void add_connection(SharedPtr 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; bool _editable; -- cgit v1.2.1