summaryrefslogtreecommitdiffstats
path: root/common/domainadaptor.h
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2015-05-31 20:51:09 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2015-05-31 20:51:09 +0200
commit9a9557b6431e8d27420603f4895e480d766f6ae2 (patch)
tree7a076e30c52c0a0d753b061ccf471d11cf5b3c79 /common/domainadaptor.h
parent69a3900feb4a0277d4e70e44256c9b37be78a2d5 (diff)
downloadsink-9a9557b6431e8d27420603f4895e480d766f6ae2.tar.gz
sink-9a9557b6431e8d27420603f4895e480d766f6ae2.zip
Use type implementation to define default buffer and buffer-builder
Diffstat (limited to 'common/domainadaptor.h')
-rw-r--r--common/domainadaptor.h16
1 files changed, 3 insertions, 13 deletions
diff --git a/common/domainadaptor.h b/common/domainadaptor.h
index 70c3a42..c9a3a01 100644
--- a/common/domainadaptor.h
+++ b/common/domainadaptor.h
@@ -25,7 +25,6 @@
25#include <functional> 25#include <functional>
26#include "clientapi.h" //for domain parts 26#include "clientapi.h" //for domain parts
27 27
28#include "event_generated.h"
29#include "entity_generated.h" 28#include "entity_generated.h"
30#include "metadata_generated.h" 29#include "metadata_generated.h"
31#include "entitybuffer.h" 30#include "entitybuffer.h"
@@ -103,17 +102,6 @@ public:
103 QSharedPointer<ReadPropertyMapper<ResourceBuffer> > mResourceMapper; 102 QSharedPointer<ReadPropertyMapper<ResourceBuffer> > mResourceMapper;
104}; 103};
105 104
106/**
107 * Initializes the local property mapper.
108 *
109 * Provide an implementation for each application domain type.
110 */
111template <class T>
112QSharedPointer<ReadPropertyMapper<T> > initializeReadPropertyMapper();
113
114template <class T>
115QSharedPointer<WritePropertyMapper<T> > initializeWritePropertyMapper();
116
117template<typename DomainType> 105template<typename DomainType>
118class DomainTypeAdaptorFactoryInterface 106class DomainTypeAdaptorFactoryInterface
119{ 107{
@@ -128,9 +116,11 @@ public:
128 * It defines how values are split accross local and resource buffer. 116 * It defines how values are split accross local and resource buffer.
129 * This is required by the facade the read the value, and by the pipeline preprocessors to access the domain values in a generic way. 117 * This is required by the facade the read the value, and by the pipeline preprocessors to access the domain values in a generic way.
130 */ 118 */
131template<typename DomainType, typename LocalBuffer, typename ResourceBuffer, typename LocalBuilder, typename ResourceBuilder> 119template<typename DomainType, typename ResourceBuffer, typename ResourceBuilder>
132class DomainTypeAdaptorFactory : public DomainTypeAdaptorFactoryInterface<DomainType> 120class DomainTypeAdaptorFactory : public DomainTypeAdaptorFactoryInterface<DomainType>
133{ 121{
122 typedef typename Akonadi2::ApplicationDomain::TypeImplementation<DomainType>::Buffer LocalBuffer;
123 typedef typename Akonadi2::ApplicationDomain::TypeImplementation<DomainType>::BufferBuilder LocalBuilder;
134public: 124public:
135 DomainTypeAdaptorFactory() : 125 DomainTypeAdaptorFactory() :
136 mLocalMapper(Akonadi2::ApplicationDomain::TypeImplementation<DomainType>::initializeReadPropertyMapper()), 126 mLocalMapper(Akonadi2::ApplicationDomain::TypeImplementation<DomainType>::initializeReadPropertyMapper()),