summaryrefslogtreecommitdiffstats
path: root/common/domainadaptor.h
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-10-19 15:28:42 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-10-21 09:18:49 +0200
commitba7c8b890c45d735216888204ec88882ef58c918 (patch)
treecb00c9b51e5353ba3726216679c81c0e2fe9ac35 /common/domainadaptor.h
parentda1c86b80f230c3a2023f97c0048020a12e38de4 (diff)
downloadsink-ba7c8b890c45d735216888204ec88882ef58c918.tar.gz
sink-ba7c8b890c45d735216888204ec88882ef58c918.zip
Ported the pipeline to the entitystore
Diffstat (limited to 'common/domainadaptor.h')
-rw-r--r--common/domainadaptor.h16
1 files changed, 6 insertions, 10 deletions
diff --git a/common/domainadaptor.h b/common/domainadaptor.h
index 6a9d755..195d5ec 100644
--- a/common/domainadaptor.h
+++ b/common/domainadaptor.h
@@ -87,11 +87,11 @@ static void createBufferPartBuffer(const Sink::ApplicationDomain::ApplicationDom
87 * A generic adaptor implementation that uses a property mapper to read/write values. 87 * A generic adaptor implementation that uses a property mapper to read/write values.
88 */ 88 */
89template <class LocalBuffer, class ResourceBuffer> 89template <class LocalBuffer, class ResourceBuffer>
90class GenericBufferAdaptor : public Sink::ApplicationDomain::BufferAdaptor 90class DatastoreBufferAdaptor : public Sink::ApplicationDomain::BufferAdaptor
91{ 91{
92 SINK_DEBUG_AREA("bufferadaptor") 92 SINK_DEBUG_AREA("bufferadaptor")
93public: 93public:
94 GenericBufferAdaptor() : BufferAdaptor() 94 DatastoreBufferAdaptor() : BufferAdaptor()
95 { 95 {
96 } 96 }
97 97
@@ -148,18 +148,14 @@ public:
148 /** 148 /**
149 * Creates an adaptor for the given domain and resource types. 149 * Creates an adaptor for the given domain and resource types.
150 * 150 *
151 * This returns by default a GenericBufferAdaptor initialized with the corresponding property mappers. 151 * This returns by default a DatastoreBufferAdaptor initialized with the corresponding property mappers.
152 */ 152 */
153 virtual QSharedPointer<Sink::ApplicationDomain::BufferAdaptor> createAdaptor(const Sink::Entity &entity) Q_DECL_OVERRIDE 153 virtual QSharedPointer<Sink::ApplicationDomain::BufferAdaptor> createAdaptor(const Sink::Entity &entity) Q_DECL_OVERRIDE
154 { 154 {
155 const auto resourceBuffer = Sink::EntityBuffer::readBuffer<ResourceBuffer>(entity.resource()); 155 auto adaptor = QSharedPointer<DatastoreBufferAdaptor<LocalBuffer, ResourceBuffer>>::create();
156 const auto localBuffer = Sink::EntityBuffer::readBuffer<LocalBuffer>(entity.local()); 156 adaptor->mLocalBuffer = Sink::EntityBuffer::readBuffer<LocalBuffer>(entity.local());
157 // const auto metadataBuffer = Sink::EntityBuffer::readBuffer<Sink::Metadata>(entity.metadata());
158
159 auto adaptor = QSharedPointer<GenericBufferAdaptor<LocalBuffer, ResourceBuffer>>::create();
160 adaptor->mLocalBuffer = localBuffer;
161 adaptor->mLocalMapper = mLocalMapper; 157 adaptor->mLocalMapper = mLocalMapper;
162 adaptor->mResourceBuffer = resourceBuffer; 158 adaptor->mResourceBuffer = Sink::EntityBuffer::readBuffer<ResourceBuffer>(entity.resource());
163 adaptor->mResourceMapper = mResourceMapper; 159 adaptor->mResourceMapper = mResourceMapper;
164 return adaptor; 160 return adaptor;
165 } 161 }