From 7bc5413b66cd60395af7f045b34b16685851b3dc Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 11 Mar 2012 01:52:43 +0000 Subject: Missing portion of previous commit (r4045). git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4046 a436a847-0d15-0410-975c-d299462d15a1 --- include/ingen/shared/ResourceImpl.hpp | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'include/ingen/shared') diff --git a/include/ingen/shared/ResourceImpl.hpp b/include/ingen/shared/ResourceImpl.hpp index 13f1bd8f..fea21023 100644 --- a/include/ingen/shared/ResourceImpl.hpp +++ b/include/ingen/shared/ResourceImpl.hpp @@ -47,15 +47,25 @@ public: Properties properties(Resource::Graph ctx) const; const Raul::Atom& get_property(const Raul::URI& uri) const; - const Raul::Atom& set_property(const Raul::URI& uri, const Raul::Atom& value, - Resource::Graph ctx=Resource::DEFAULT); - void remove_property(const Raul::URI& uri, const Raul::Atom& value); - bool has_property(const Raul::URI& uri, const Raul::Atom& value) const; - void add_property(const Raul::URI& uri, const Raul::Atom& value, - Graph ctx=DEFAULT); - void set_properties(const Properties& p); - void add_properties(const Properties& p); - void remove_properties(const Properties& p); + + const Raul::Atom& set_property(const Raul::URI& uri, + const Raul::Atom& value, + Resource::Graph ctx=Resource::DEFAULT); + + /** Hook called whenever a property is added. + * This can be used by derived classes to implement special behaviour for + * particular properties (e.g. ingen:value for ports). + */ + virtual void on_property(const Raul::URI& uri, const Raul::Atom& value) {} + + void remove_property(const Raul::URI& uri, const Raul::Atom& value); + bool has_property(const Raul::URI& uri, const Raul::Atom& value) const; + void add_property(const Raul::URI& uri, + const Raul::Atom& value, + Graph ctx = DEFAULT); + void set_properties(const Properties& p); + void add_properties(const Properties& p); + void remove_properties(const Properties& p); void dump(std::ostream& os) const; -- cgit v1.2.1