Ingen
0.5.1
|
An object with a URI described by properties. More...
#include <Resource.hpp>
Classes | |
class | Properties |
class | Property |
A property value (an Atom with a context). More... | |
Public Types | |
enum | Graph { DEFAULT, EXTERNAL, INTERNAL } |
Public Member Functions | |
Resource (const URIs &uris, const Raul::URI &uri) | |
Resource & | operator= (const Resource &rhs) |
virtual const Atom & | get_property (const Raul::URI &uri) const |
Get a single property value. More... | |
virtual const Atom & | set_property (const Raul::URI &uri, const Atom &value, Graph ctx=Graph::DEFAULT) |
Set (replace) a property value. More... | |
virtual const Atom & | set_property (const Raul::URI &uri, const URIs::Quark &value, Graph ctx=Graph::DEFAULT) |
Set (replace) a property value. More... | |
virtual bool | add_property (const Raul::URI &uri, const Atom &value, Graph ctx=Graph::DEFAULT) |
Add a property value. More... | |
virtual void | remove_property (const Raul::URI &uri, const Atom &value) |
Remove a property. More... | |
virtual void | remove_property (const Raul::URI &uri, const URIs::Quark &value) |
Remove a property. More... | |
virtual bool | has_property (const Raul::URI &uri, const Atom &value) const |
Return true iff a property is set with a specific value. More... | |
virtual bool | has_property (const Raul::URI &uri, const URIs::Quark &value) const |
Return true iff a property is set with a specific value. More... | |
void | set_properties (const Properties &p) |
Set (replace) several properties at once. More... | |
void | add_properties (const Properties &p) |
Add several properties at once. More... | |
void | remove_properties (const Properties &p) |
Remove several properties at once. More... | |
virtual void | on_property (const Raul::URI &uri, const Atom &value) |
Hook called whenever a property is added. More... | |
virtual void | on_property_removed (const Raul::URI &uri, const Atom &value) |
Hook called whenever a property value is removed. More... | |
virtual void | set_uri (const Raul::URI &uri) |
Properties | properties (Resource::Graph ctx) const |
Get all the properties with a given context. More... | |
const URIs & | uris () const |
const Raul::URI & | uri () const |
const Properties & | properties () const |
Properties & | properties () |
Static Public Member Functions | |
static Raul::URI | graph_to_uri (Graph g) |
static Graph | uri_to_graph (const char *uri) |
static bool | type (const URIs &uris, const Properties &properties, bool &graph, bool &block, bool &port, bool &is_output) |
Get the ingen type from a set of Properties. More... | |
Protected Member Functions | |
const Atom & | set_property (const Raul::URI &uri, const Atom &value) const |
Protected Attributes | |
const URIs & | _uris |
An object with a URI described by properties.
|
virtual |
Get a single property value.
This is only useful for properties with a single value. If the requested property has several values, the first will be returned.
Reimplemented in Ingen::Server::NodeImpl, Ingen::Client::ObjectModel, and Ingen::Client::PluginModel.
Referenced by Ingen::Client::PluginModel::get_property(), and Ingen::Serialiser::serialise().
|
virtual |
Set (replace) a property value.
This will first erase any properties with the given uri
, so after this call exactly one property with predicate uri
will be set.
Referenced by Ingen::Server::InternalBlock::duplicate(), Ingen::Client::PluginModel::get_property(), Ingen::Server::LV2Block::save_preset(), Ingen::Serialiser::serialise(), and Ingen::Client::ObjectModel::set().
|
virtual |
Set (replace) a property value.
This will first erase any properties with the given uri
, so after this call exactly one property with predicate uri
will be set.
|
virtual |
Add a property value.
This will not remove any existing values, so if properties with predicate uri
and values other than value
exist, this will result in multiple values for the property.
Referenced by Ingen::Server::LV2Block::instantiate().
|
virtual |
Remove a property.
If value
is patch:wildcard then any property with uri
for a predicate will be removed.
|
virtual |
Remove a property.
If value
is patch:wildcard then any property with uri
for a predicate will be removed.
|
virtual |
Return true iff a property is set with a specific value.
Referenced by Ingen::Client::PortModel::on_property(), and Ingen::Serialiser::serialise().
|
virtual |
Return true iff a property is set with a specific value.
void Ingen::Resource::set_properties | ( | const Properties & | p | ) |
Set (replace) several properties at once.
This will erase all properties with keys in p
, though multiple values for one property may exist in p
will all be set (unlike simply calling set_property in a loop which would only set one value).
Referenced by Ingen::Server::GraphImpl::duplicate().
void Ingen::Resource::add_properties | ( | const Properties & | p | ) |
Add several properties at once.
void Ingen::Resource::remove_properties | ( | const Properties & | p | ) |
Remove several properties at once.
This removes all matching properties (both key and value), or all properties with a matching key if the value in p
is patch:wildcard.
|
inlinevirtual |
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).
Reimplemented in Ingen::Client::PortModel, Ingen::Server::DuplexPort, and Ingen::Client::ObjectModel.
|
inlinevirtual |
Hook called whenever a property value is removed.
If all values for a key are removed, then value will be the wildcard.
This can be used by derived classes to implement special behaviour for particular properties (e.g. ingen:value for ports).
Reimplemented in Ingen::Client::ObjectModel.
|
static |
Get the ingen type from a set of Properties.
If some coherent ingen type is found, true is returned and the appropriate output parameter set to true. Otherwise false is returned.
Referenced by Ingen::Server::LV2Block::apply_state(), Ingen::Server::LV2Block::instantiate(), and Ingen::Server::LV2Block::LV2Block().
Resource::Properties Ingen::Resource::properties | ( | Resource::Graph | ctx | ) | const |
Get all the properties with a given context.
Referenced by Ingen::Server::LV2Block::duplicate(), Ingen::Server::NodeImpl::get_property(), Ingen::Server::DuplexPort::inherit_neighbour(), Ingen::Client::PortModel::on_property(), Ingen::Server::JackDriver::register_port(), Ingen::Serialiser::serialise(), and Ingen::Server::Broadcaster::unregister_client().