diff options
Diffstat (limited to 'src/libs/client/ObjectModel.cpp')
-rw-r--r-- | src/libs/client/ObjectModel.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/libs/client/ObjectModel.cpp b/src/libs/client/ObjectModel.cpp index 0afb9ad8..e9a491a6 100644 --- a/src/libs/client/ObjectModel.cpp +++ b/src/libs/client/ObjectModel.cpp @@ -54,6 +54,23 @@ ObjectModel::get_variable(const string& key) const } +/** Get a variable for this object. + * + * @return Metadata value with key @a key, empty string otherwise. + */ +Atom& +ObjectModel::get_variable( string& key) +{ + static Atom null_atom; + + Variables::iterator i = _variables.find(key); + if (i != _variables.end()) + return i->second; + else + return null_atom; +} + + /** Get a property of this object. * * @return Metadata value with key @a key, empty string otherwise. @@ -71,6 +88,23 @@ ObjectModel::get_property(const string& key) const } +/** Get a property of this object. + * + * @return Metadata value with key @a key, empty string otherwise. + */ +Atom& +ObjectModel::get_property(const string& key) +{ + static Atom null_atom; + + Properties::iterator i = _properties.find(key); + if (i != _properties.end()) + return i->second; + else + return null_atom; +} + + bool ObjectModel::polyphonic() const { |