diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-07-14 01:05:20 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-07-14 01:05:20 +0200 |
commit | 8146bd3276c4b26018814446803dac7aa944797c (patch) | |
tree | 7ce2693d3bd08b97c45860f91fd07e262a49747a | |
parent | 5d31ad5cc706ed1ad69df13750e7003481719aae (diff) | |
download | sink-8146bd3276c4b26018814446803dac7aa944797c.tar.gz sink-8146bd3276c4b26018814446803dac7aa944797c.zip |
Removed unnecessary template parameter
-rw-r--r-- | common/domainadaptor.h | 8 | ||||
-rw-r--r-- | common/facade.h | 10 |
2 files changed, 9 insertions, 9 deletions
diff --git a/common/domainadaptor.h b/common/domainadaptor.h index ca89fba..48a0507 100644 --- a/common/domainadaptor.h +++ b/common/domainadaptor.h | |||
@@ -122,13 +122,13 @@ public: | |||
122 | QSharedPointer<ReadPropertyMapper<ResourceBuffer> > mResourceMapper; | 122 | QSharedPointer<ReadPropertyMapper<ResourceBuffer> > mResourceMapper; |
123 | }; | 123 | }; |
124 | 124 | ||
125 | template<typename DomainType> | ||
126 | class DomainTypeAdaptorFactoryInterface | 125 | class DomainTypeAdaptorFactoryInterface |
127 | { | 126 | { |
128 | public: | 127 | public: |
128 | typedef QSharedPointer<DomainTypeAdaptorFactoryInterface> Ptr; | ||
129 | virtual ~DomainTypeAdaptorFactoryInterface() {}; | 129 | virtual ~DomainTypeAdaptorFactoryInterface() {}; |
130 | virtual QSharedPointer<Akonadi2::ApplicationDomain::BufferAdaptor> createAdaptor(const Akonadi2::Entity &entity) = 0; | 130 | virtual QSharedPointer<Akonadi2::ApplicationDomain::BufferAdaptor> createAdaptor(const Akonadi2::Entity &entity) = 0; |
131 | virtual void createBuffer(const DomainType &domainType, flatbuffers::FlatBufferBuilder &fbb) = 0; | 131 | virtual void createBuffer(const Akonadi2::ApplicationDomain::ApplicationDomainType &domainType, flatbuffers::FlatBufferBuilder &fbb) = 0; |
132 | }; | 132 | }; |
133 | 133 | ||
134 | /** | 134 | /** |
@@ -137,7 +137,7 @@ public: | |||
137 | * This is required by the facade the read the value, and by the pipeline preprocessors to access the domain values in a generic way. | 137 | * This is required by the facade the read the value, and by the pipeline preprocessors to access the domain values in a generic way. |
138 | */ | 138 | */ |
139 | template<typename DomainType, typename ResourceBuffer, typename ResourceBuilder> | 139 | template<typename DomainType, typename ResourceBuffer, typename ResourceBuilder> |
140 | class DomainTypeAdaptorFactory : public DomainTypeAdaptorFactoryInterface<DomainType> | 140 | class DomainTypeAdaptorFactory : public DomainTypeAdaptorFactoryInterface |
141 | { | 141 | { |
142 | typedef typename Akonadi2::ApplicationDomain::TypeImplementation<DomainType>::Buffer LocalBuffer; | 142 | typedef typename Akonadi2::ApplicationDomain::TypeImplementation<DomainType>::Buffer LocalBuffer; |
143 | typedef typename Akonadi2::ApplicationDomain::TypeImplementation<DomainType>::BufferBuilder LocalBuilder; | 143 | typedef typename Akonadi2::ApplicationDomain::TypeImplementation<DomainType>::BufferBuilder LocalBuilder; |
@@ -169,7 +169,7 @@ public: | |||
169 | return adaptor; | 169 | return adaptor; |
170 | } | 170 | } |
171 | 171 | ||
172 | virtual void createBuffer(const DomainType &domainObject, flatbuffers::FlatBufferBuilder &fbb) Q_DECL_OVERRIDE | 172 | virtual void createBuffer(const Akonadi2::ApplicationDomain::ApplicationDomainType &domainObject, flatbuffers::FlatBufferBuilder &fbb) Q_DECL_OVERRIDE |
173 | { | 173 | { |
174 | flatbuffers::FlatBufferBuilder localFbb; | 174 | flatbuffers::FlatBufferBuilder localFbb; |
175 | if (mLocalWriteMapper) { | 175 | if (mLocalWriteMapper) { |
diff --git a/common/facade.h b/common/facade.h index e32ee96..ad79213 100644 --- a/common/facade.h +++ b/common/facade.h | |||
@@ -106,7 +106,7 @@ public: | |||
106 | * @param resourceIdentifier is the identifier of the resource instance | 106 | * @param resourceIdentifier is the identifier of the resource instance |
107 | * @param adaptorFactory is the adaptor factory used to generate the mappings from domain to resource types and vice versa | 107 | * @param adaptorFactory is the adaptor factory used to generate the mappings from domain to resource types and vice versa |
108 | */ | 108 | */ |
109 | GenericFacade(const QByteArray &resourceIdentifier, const QSharedPointer<DomainTypeAdaptorFactoryInterface<DomainType> > &adaptorFactory = QSharedPointer<DomainTypeAdaptorFactoryInterface<DomainType> >()) | 109 | GenericFacade(const QByteArray &resourceIdentifier, const DomainTypeAdaptorFactoryInterface::Ptr &adaptorFactory = DomainTypeAdaptorFactoryInterface::Ptr()) |
110 | : Akonadi2::StoreFacade<DomainType>(), | 110 | : Akonadi2::StoreFacade<DomainType>(), |
111 | mResourceAccess(new ResourceAccess(resourceIdentifier)), | 111 | mResourceAccess(new ResourceAccess(resourceIdentifier)), |
112 | mDomainTypeAdaptorFactory(adaptorFactory), | 112 | mDomainTypeAdaptorFactory(adaptorFactory), |
@@ -244,7 +244,7 @@ protected: | |||
244 | }); | 244 | }); |
245 | } | 245 | } |
246 | 246 | ||
247 | static void readValue(const QSharedPointer<Akonadi2::Storage> &storage, const QByteArray &key, const std::function<void(const typename DomainType::Ptr &)> &resultCallback, const QSharedPointer<DomainTypeAdaptorFactoryInterface<DomainType> > &adaptorFactory) | 247 | static void readValue(const QSharedPointer<Akonadi2::Storage> &storage, const QByteArray &key, const std::function<void(const typename DomainType::Ptr &)> &resultCallback, const DomainTypeAdaptorFactoryInterface::Ptr &adaptorFactory) |
248 | { | 248 | { |
249 | scan(storage, key, [=](const QByteArray &key, const Akonadi2::Entity &entity) { | 249 | scan(storage, key, [=](const QByteArray &key, const Akonadi2::Entity &entity) { |
250 | const auto metadataBuffer = Akonadi2::EntityBuffer::readBuffer<Akonadi2::Metadata>(entity.metadata()); | 250 | const auto metadataBuffer = Akonadi2::EntityBuffer::readBuffer<Akonadi2::Metadata>(entity.metadata()); |
@@ -270,7 +270,7 @@ protected: | |||
270 | return ResultSet(keys); | 270 | return ResultSet(keys); |
271 | } | 271 | } |
272 | 272 | ||
273 | static ResultSet filteredSet(const ResultSet &resultSet, const std::function<bool(const Akonadi2::ApplicationDomain::ApplicationDomainType::Ptr &domainObject)> &filter, const QSharedPointer<Akonadi2::Storage> &storage, const QSharedPointer<DomainTypeAdaptorFactoryInterface<DomainType> > &adaptorFactory) | 273 | static ResultSet filteredSet(const ResultSet &resultSet, const std::function<bool(const Akonadi2::ApplicationDomain::ApplicationDomainType::Ptr &domainObject)> &filter, const QSharedPointer<Akonadi2::Storage> &storage, const DomainTypeAdaptorFactoryInterface::Ptr &adaptorFactory) |
274 | { | 274 | { |
275 | auto resultSetPtr = QSharedPointer<ResultSet>::create(resultSet); | 275 | auto resultSetPtr = QSharedPointer<ResultSet>::create(resultSet); |
276 | 276 | ||
@@ -288,7 +288,7 @@ protected: | |||
288 | return ResultSet(generator); | 288 | return ResultSet(generator); |
289 | } | 289 | } |
290 | 290 | ||
291 | static ResultSet getResultSet(const Akonadi2::Query &query, const QSharedPointer<Akonadi2::Storage> &storage, const QSharedPointer<DomainTypeAdaptorFactoryInterface<DomainType> > &adaptorFactory, const QByteArray &resourceInstanceIdentifier) | 291 | static ResultSet getResultSet(const Akonadi2::Query &query, const QSharedPointer<Akonadi2::Storage> &storage, const DomainTypeAdaptorFactoryInterface::Ptr &adaptorFactory, const QByteArray &resourceInstanceIdentifier) |
292 | { | 292 | { |
293 | QSet<QByteArray> appliedFilters; | 293 | QSet<QByteArray> appliedFilters; |
294 | ResultSet resultSet = Akonadi2::ApplicationDomain::TypeImplementation<DomainType>::queryIndexes(query, resourceInstanceIdentifier, appliedFilters); | 294 | ResultSet resultSet = Akonadi2::ApplicationDomain::TypeImplementation<DomainType>::queryIndexes(query, resourceInstanceIdentifier, appliedFilters); |
@@ -342,7 +342,7 @@ private: | |||
342 | protected: | 342 | protected: |
343 | //TODO use one resource access instance per application => make static | 343 | //TODO use one resource access instance per application => make static |
344 | QSharedPointer<Akonadi2::ResourceAccess> mResourceAccess; | 344 | QSharedPointer<Akonadi2::ResourceAccess> mResourceAccess; |
345 | QSharedPointer<DomainTypeAdaptorFactoryInterface<DomainType> > mDomainTypeAdaptorFactory; | 345 | DomainTypeAdaptorFactoryInterface::Ptr mDomainTypeAdaptorFactory; |
346 | QByteArray mResourceInstanceIdentifier; | 346 | QByteArray mResourceInstanceIdentifier; |
347 | }; | 347 | }; |
348 | 348 | ||