From 94d2f7cfc7e573c6fdd7487b1ab207d01e9fdbcf Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 25 Oct 2015 05:10:37 +0000 Subject: Create all graphs the same way This ensures that subgraphs always have the standard control ports, so they are valid Ingen graphs on their own.. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5783 a436a847-0d15-0410-975c-d299462d15a1 --- ingen/Resource.hpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'ingen') diff --git a/ingen/Resource.hpp b/ingen/Resource.hpp index d798b009..31d23dac 100644 --- a/ingen/Resource.hpp +++ b/ingen/Resource.hpp @@ -99,7 +99,30 @@ public: virtual ~Resource() {} - typedef std::multimap Properties; + class Properties : public std::multimap { + public: + Properties() {} + + Properties(const Properties& copy) + : std::multimap(copy) + {} + + Properties(std::initializer_list l) + : std::multimap(l) + {} + + void put(const Raul::URI& key, + const Atom& value, + Graph ctx = Graph::DEFAULT) { + insert(std::make_pair(key, Property(value, ctx))); + } + + void put(const Raul::URI& key, + const URIs::Quark& value, + Graph ctx = Graph::DEFAULT) { + insert(std::make_pair(key, Property(value, ctx))); + } + }; /** Get a single property value. * -- cgit v1.2.1