summaryrefslogtreecommitdiffstats
path: root/src/shared/ResourceImpl.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-02-19 05:10:29 +0000
committerDavid Robillard <d@drobilla.net>2011-02-19 05:10:29 +0000
commit6b18de71d1c603255b263a64434005306f152f13 (patch)
tree09c6e87acca1fe76bc74b3b549fee7ad09751993 /src/shared/ResourceImpl.cpp
parent8e07e115429a0869593d4f29dc3e6cf5c8b25049 (diff)
downloadingen-6b18de71d1c603255b263a64434005306f152f13.tar.gz
ingen-6b18de71d1c603255b263a64434005306f152f13.tar.bz2
ingen-6b18de71d1c603255b263a64434005306f152f13.zip
Save/load patches as nested bundles (fix ticket #520).
Sane (context-based, ala RDF quads) approach to the problem of externally visible / internally visible properties. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2993 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/shared/ResourceImpl.cpp')
-rw-r--r--src/shared/ResourceImpl.cpp36
1 files changed, 20 insertions, 16 deletions
diff --git a/src/shared/ResourceImpl.cpp b/src/shared/ResourceImpl.cpp
index dc9bfbae..8b8a56ec 100644
--- a/src/shared/ResourceImpl.cpp
+++ b/src/shared/ResourceImpl.cpp
@@ -27,20 +27,6 @@ namespace Ingen {
namespace Shared {
-bool
-ResourceImpl::is_meta_uri(const Raul::URI& uri)
-{
- return uri.substr(0, 6) == "meta:#";
-}
-
-
-const Raul::URI
-ResourceImpl::meta_uri(const Raul::URI& uri)
-{
- return string("meta:#") + uri.chop_start("/");
-}
-
-
void
ResourceImpl::add_property(const Raul::URI& uri, const Raul::Atom& value)
{
@@ -154,8 +140,6 @@ ResourceImpl::type(
} else if (atom == uris.atom_MessagePort) {
data_type = PortType::MESSAGE;
port = true;
- } else {
- warn << "[ResourceImpl] Unrecognized type " << atom << endl;
}
}
@@ -225,5 +209,25 @@ ResourceImpl::dump(std::ostream& os) const
}
+Resource::Properties
+ResourceImpl::properties(Resource::Graph ctx) const
+{
+ if (ctx == Resource::DEFAULT) {
+ return properties();
+ }
+
+ typedef Resource::Properties::const_iterator iterator;
+
+ Properties props;
+ for (iterator i = _properties.begin(); i != _properties.end(); ++i) {
+ if (i->second.context() == Resource::DEFAULT
+ || i->second.context() == ctx) {
+ props.insert(make_pair(i->first, i->second));
+ }
+ }
+
+ return props;
+}
+
} // namespace Shared
} // namespace Ingen