summaryrefslogtreecommitdiffstats
path: root/common/storage/entitystore.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-12-08 13:18:19 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-12-08 13:18:19 +0100
commitae4b64b198a143240aa5dd1e202e5016abfdae71 (patch)
tree5d9d58a512ebc60c44637d11c9424f67a02887e8 /common/storage/entitystore.cpp
parentf425c2070131161dc11bcf70e35f8d1848cadb65 (diff)
downloadsink-ae4b64b198a143240aa5dd1e202e5016abfdae71.tar.gz
sink-ae4b64b198a143240aa5dd1e202e5016abfdae71.zip
Wrap references in a Reerence type.
This allows us to make sure that references are not taken out of context (the resource). Because we need to use the type-specific accessors more we also ran into a problem that we cannot "downcast" a reference with the change recording still working, for that we have the cast<T>() operator now.
Diffstat (limited to 'common/storage/entitystore.cpp')
-rw-r--r--common/storage/entitystore.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/common/storage/entitystore.cpp b/common/storage/entitystore.cpp
index 7414f49..999bb2c 100644
--- a/common/storage/entitystore.cpp
+++ b/common/storage/entitystore.cpp
@@ -205,9 +205,10 @@ bool EntityStore::modify(const QByteArray &type, const ApplicationDomain::Applic
205 auto metadataBuffer = metadataBuilder.Finish(); 205 auto metadataBuffer = metadataBuilder.Finish();
206 FinishMetadataBuffer(metadataFbb, metadataBuffer); 206 FinishMetadataBuffer(metadataFbb, metadataBuffer);
207 } 207 }
208 SinkTrace() << "Modified entity: " << newEntity;
209 SinkTrace() << "Changed properties: " << changeset + newEntity.changedProperties();
208 210
209 newEntity.setChangedProperties(newEntity.availableProperties().toSet()); 211 newEntity.setChangedProperties(newEntity.availableProperties().toSet());
210 SinkTrace() << "Modified entity " << newEntity;
211 212
212 flatbuffers::FlatBufferBuilder fbb; 213 flatbuffers::FlatBufferBuilder fbb;
213 d->resourceContext.adaptorFactory(type).createBuffer(newEntity, fbb, metadataFbb.GetBufferPointer(), metadataFbb.GetSize()); 214 d->resourceContext.adaptorFactory(type).createBuffer(newEntity, fbb, metadataFbb.GetBufferPointer(), metadataFbb.GetSize());