summaryrefslogtreecommitdiffstats
path: root/src/shared
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-05-13 06:14:40 +0000
committerDavid Robillard <d@drobilla.net>2009-05-13 06:14:40 +0000
commita95e08e48c2d1f68693609627c6d6f52c6982264 (patch)
tree0feed2d49d10d6e8880bef4a7e88c52584c094cf /src/shared
parentf62ef545425476959b1335f3a303d6d5f80ca0e5 (diff)
downloadingen-a95e08e48c2d1f68693609627c6d6f52c6982264.tar.gz
ingen-a95e08e48c2d1f68693609627c6d6f52c6982264.tar.bz2
ingen-a95e08e48c2d1f68693609627c6d6f52c6982264.zip
Generic simple query system for both objects and plugins.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1997 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/ClashAvoider.cpp19
-rw-r--r--src/shared/ClashAvoider.hpp5
2 files changed, 17 insertions, 7 deletions
diff --git a/src/shared/ClashAvoider.cpp b/src/shared/ClashAvoider.cpp
index 24569369..4995aa5e 100644
--- a/src/shared/ClashAvoider.cpp
+++ b/src/shared/ClashAvoider.cpp
@@ -26,7 +26,16 @@ namespace Ingen {
namespace Shared {
-/** Always returns a valid Raul::Path */
+const URI
+ClashAvoider::map_uri(const Raul::URI& in)
+{
+ if (in.scheme() == Path::scheme && Path::is_valid(in.str()))
+ return map_path(in.str());
+ else
+ return in;
+}
+
+
const Path
ClashAvoider::map_path(const Raul::Path& in)
{
@@ -192,20 +201,20 @@ ClashAvoider::disconnect(const Raul::Path& src_port_path,
void
-ClashAvoider::set_variable(const Raul::Path& subject_path,
+ClashAvoider::set_variable(const Raul::URI& subject_path,
const Raul::URI& predicate,
const Raul::Atom& value)
{
- _target.set_variable(map_path(subject_path), predicate, value);
+ _target.set_variable(map_uri(subject_path), predicate, value);
}
void
-ClashAvoider::set_property(const Raul::Path& subject_path,
+ClashAvoider::set_property(const Raul::URI& subject_path,
const Raul::URI& predicate,
const Raul::Atom& value)
{
- _target.set_property(map_path(subject_path), predicate, value);
+ _target.set_property(map_uri(subject_path), predicate, value);
}
diff --git a/src/shared/ClashAvoider.hpp b/src/shared/ClashAvoider.hpp
index 0692a59a..0334610d 100644
--- a/src/shared/ClashAvoider.hpp
+++ b/src/shared/ClashAvoider.hpp
@@ -70,11 +70,11 @@ public:
virtual void disconnect(const Raul::Path& src_port_path,
const Raul::Path& dst_port_path);
- virtual void set_variable(const Raul::Path& subject_path,
+ virtual void set_variable(const Raul::URI& subject_path,
const Raul::URI& predicate,
const Raul::Atom& value);
- virtual void set_property(const Raul::Path& subject_path,
+ virtual void set_property(const Raul::URI& subject_path,
const Raul::URI& predicate,
const Raul::Atom& value);
@@ -90,6 +90,7 @@ public:
virtual void clear_patch(const Raul::Path& patch_path);
private:
+ const Raul::URI map_uri(const Raul::URI& in);
const Raul::Path map_path(const Raul::Path& in);
Store& _store;