summaryrefslogtreecommitdiffstats
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/ResourceImpl.cpp12
-rw-r--r--src/shared/ResourceImpl.hpp3
2 files changed, 9 insertions, 6 deletions
diff --git a/src/shared/ResourceImpl.cpp b/src/shared/ResourceImpl.cpp
index 729a8152..e6f4ba70 100644
--- a/src/shared/ResourceImpl.cpp
+++ b/src/shared/ResourceImpl.cpp
@@ -27,16 +27,18 @@ namespace Ingen {
namespace Shared {
void
-ResourceImpl::add_property(const Raul::URI& uri, const Raul::Atom& value)
+ResourceImpl::add_property(const Raul::URI& uri,
+ const Raul::Atom& value,
+ Graph ctx)
{
// Ignore duplicate statements
typedef Resource::Properties::const_iterator iterator;
const std::pair<iterator,iterator> range = _properties.equal_range(uri);
for (iterator i = range.first; i != range.second && i != _properties.end(); ++i)
- if (i->second == value)
+ if (i->second == value && i->second.context() == ctx)
return;
- _properties.insert(make_pair(uri, value));
+ _properties.insert(make_pair(uri, Property(value, ctx)));
}
const Raul::Atom&
@@ -165,7 +167,7 @@ void
ResourceImpl::set_properties(const Properties& p)
{
for (Resource::Properties::const_iterator i = p.begin(); i != p.end(); ++i) {
- set_property(i->first, i->second);
+ set_property(i->first, i->second, i->second.context());
}
}
@@ -174,7 +176,7 @@ ResourceImpl::add_properties(const Properties& p)
{
typedef Resource::Properties::const_iterator iterator;
for (iterator i = p.begin(); i != p.end(); ++i)
- add_property(i->first, i->second);
+ add_property(i->first, i->second, i->second.context());
}
void
diff --git a/src/shared/ResourceImpl.hpp b/src/shared/ResourceImpl.hpp
index 0d96d840..6f5a2ed2 100644
--- a/src/shared/ResourceImpl.hpp
+++ b/src/shared/ResourceImpl.hpp
@@ -50,7 +50,8 @@ public:
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);
+ 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);