diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-05-31 20:51:09 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-05-31 20:51:09 +0200 |
commit | 9a9557b6431e8d27420603f4895e480d766f6ae2 (patch) | |
tree | 7a076e30c52c0a0d753b061ccf471d11cf5b3c79 /common/domainadaptor.h | |
parent | 69a3900feb4a0277d4e70e44256c9b37be78a2d5 (diff) | |
download | sink-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.h | 16 |
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 | */ | ||
111 | template <class T> | ||
112 | QSharedPointer<ReadPropertyMapper<T> > initializeReadPropertyMapper(); | ||
113 | |||
114 | template <class T> | ||
115 | QSharedPointer<WritePropertyMapper<T> > initializeWritePropertyMapper(); | ||
116 | |||
117 | template<typename DomainType> | 105 | template<typename DomainType> |
118 | class DomainTypeAdaptorFactoryInterface | 106 | class 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 | */ |
131 | template<typename DomainType, typename LocalBuffer, typename ResourceBuffer, typename LocalBuilder, typename ResourceBuilder> | 119 | template<typename DomainType, typename ResourceBuffer, typename ResourceBuilder> |
132 | class DomainTypeAdaptorFactory : public DomainTypeAdaptorFactoryInterface<DomainType> | 120 | class DomainTypeAdaptorFactory : public DomainTypeAdaptorFactoryInterface<DomainType> |
133 | { | 121 | { |
122 | typedef typename Akonadi2::ApplicationDomain::TypeImplementation<DomainType>::Buffer LocalBuffer; | ||
123 | typedef typename Akonadi2::ApplicationDomain::TypeImplementation<DomainType>::BufferBuilder LocalBuilder; | ||
134 | public: | 124 | public: |
135 | DomainTypeAdaptorFactory() : | 125 | DomainTypeAdaptorFactory() : |
136 | mLocalMapper(Akonadi2::ApplicationDomain::TypeImplementation<DomainType>::initializeReadPropertyMapper()), | 126 | mLocalMapper(Akonadi2::ApplicationDomain::TypeImplementation<DomainType>::initializeReadPropertyMapper()), |