diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-04-09 15:21:06 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-04-09 15:21:06 +0200 |
commit | cc3fed3668a80616ec78bc872e21b7ac06bcde38 (patch) | |
tree | ab4888ae0050e5b56f59662dd356523b3a421043 /common | |
parent | c4e098fae7340d6d73cd4fbe880440baca1ddd49 (diff) | |
download | sink-cc3fed3668a80616ec78bc872e21b7ac06bcde38.tar.gz sink-cc3fed3668a80616ec78bc872e21b7ac06bcde38.zip |
Renamed Akonadi::Domain to Akonadi::ApplicationDomain
Because it's really the application domain and not the akonadi domain.
Diffstat (limited to 'common')
-rw-r--r-- | common/clientapi.cpp | 2 | ||||
-rw-r--r-- | common/clientapi.h | 36 | ||||
-rw-r--r-- | common/domain/event.fbs | 2 | ||||
-rw-r--r-- | common/domainadaptor.h | 4 | ||||
-rw-r--r-- | common/test/clientapitest.cpp | 18 |
5 files changed, 31 insertions, 31 deletions
diff --git a/common/clientapi.cpp b/common/clientapi.cpp index 0281b79..48de1b0 100644 --- a/common/clientapi.cpp +++ b/common/clientapi.cpp | |||
@@ -14,7 +14,7 @@ namespace async | |||
14 | namespace Akonadi2 | 14 | namespace Akonadi2 |
15 | { | 15 | { |
16 | 16 | ||
17 | namespace Domain | 17 | namespace ApplicationDomain |
18 | { | 18 | { |
19 | 19 | ||
20 | template<> | 20 | template<> |
diff --git a/common/clientapi.h b/common/clientapi.h index 37fb185..5182547 100644 --- a/common/clientapi.h +++ b/common/clientapi.h | |||
@@ -163,7 +163,7 @@ namespace async { | |||
163 | namespace Akonadi2 { | 163 | namespace Akonadi2 { |
164 | 164 | ||
165 | /** | 165 | /** |
166 | * Standardized Domain Types | 166 | * Standardized Application Domain Types |
167 | * | 167 | * |
168 | * They don't adhere to any standard and can be freely extended | 168 | * They don't adhere to any standard and can be freely extended |
169 | * Their sole purpose is providing a standardized interface to access data. | 169 | * Their sole purpose is providing a standardized interface to access data. |
@@ -172,7 +172,7 @@ namespace Akonadi2 { | |||
172 | * | 172 | * |
173 | * These types will be frequently modified (for every new feature that should be exposed to the any client) | 173 | * These types will be frequently modified (for every new feature that should be exposed to the any client) |
174 | */ | 174 | */ |
175 | namespace Domain { | 175 | namespace ApplicationDomain { |
176 | 176 | ||
177 | /** | 177 | /** |
178 | * This class has to be implemented by resources and can be used as generic interface to access the buffer properties | 178 | * This class has to be implemented by resources and can be used as generic interface to access the buffer properties |
@@ -215,14 +215,14 @@ private: | |||
215 | * * provide a unified interface to read buffers (for zero-copy reading) | 215 | * * provide a unified interface to read buffers (for zero-copy reading) |
216 | * * record changes to generate changesets for modifications | 216 | * * record changes to generate changesets for modifications |
217 | */ | 217 | */ |
218 | class AkonadiDomainType { | 218 | class ApplicationDomainType { |
219 | public: | 219 | public: |
220 | AkonadiDomainType() | 220 | ApplicationDomainType() |
221 | :mAdaptor(new MemoryBufferAdaptor()) | 221 | :mAdaptor(new MemoryBufferAdaptor()) |
222 | { | 222 | { |
223 | 223 | ||
224 | } | 224 | } |
225 | AkonadiDomainType(const QByteArray &resourceName, const QByteArray &identifier, qint64 revision, const QSharedPointer<BufferAdaptor> &adaptor) | 225 | ApplicationDomainType(const QByteArray &resourceName, const QByteArray &identifier, qint64 revision, const QSharedPointer<BufferAdaptor> &adaptor) |
226 | : mAdaptor(adaptor), | 226 | : mAdaptor(adaptor), |
227 | mResourceName(resourceName), | 227 | mResourceName(resourceName), |
228 | mIdentifier(identifier), | 228 | mIdentifier(identifier), |
@@ -230,7 +230,7 @@ public: | |||
230 | { | 230 | { |
231 | } | 231 | } |
232 | 232 | ||
233 | virtual ~AkonadiDomainType() {} | 233 | virtual ~ApplicationDomainType() {} |
234 | 234 | ||
235 | virtual QVariant getProperty(const QByteArray &key) const { return mAdaptor->getProperty(key); } | 235 | virtual QVariant getProperty(const QByteArray &key) const { return mAdaptor->getProperty(key); } |
236 | virtual void setProperty(const QByteArray &key, const QVariant &value){ mChangeSet.insert(key, value); mAdaptor->setProperty(key, value); } | 236 | virtual void setProperty(const QByteArray &key, const QVariant &value){ mChangeSet.insert(key, value); mAdaptor->setProperty(key, value); } |
@@ -246,25 +246,25 @@ private: | |||
246 | qint64 mRevision; | 246 | qint64 mRevision; |
247 | }; | 247 | }; |
248 | 248 | ||
249 | struct Event : public AkonadiDomainType { | 249 | struct Event : public ApplicationDomainType { |
250 | typedef QSharedPointer<Event> Ptr; | 250 | typedef QSharedPointer<Event> Ptr; |
251 | using AkonadiDomainType::AkonadiDomainType; | 251 | using ApplicationDomainType::ApplicationDomainType; |
252 | }; | 252 | }; |
253 | 253 | ||
254 | struct Todo : public AkonadiDomainType { | 254 | struct Todo : public ApplicationDomainType { |
255 | typedef QSharedPointer<Todo> Ptr; | 255 | typedef QSharedPointer<Todo> Ptr; |
256 | using AkonadiDomainType::AkonadiDomainType; | 256 | using ApplicationDomainType::ApplicationDomainType; |
257 | }; | 257 | }; |
258 | 258 | ||
259 | struct Calendar : public AkonadiDomainType { | 259 | struct Calendar : public ApplicationDomainType { |
260 | typedef QSharedPointer<Calendar> Ptr; | 260 | typedef QSharedPointer<Calendar> Ptr; |
261 | using AkonadiDomainType::AkonadiDomainType; | 261 | using ApplicationDomainType::ApplicationDomainType; |
262 | }; | 262 | }; |
263 | 263 | ||
264 | class Mail : public AkonadiDomainType { | 264 | class Mail : public ApplicationDomainType { |
265 | }; | 265 | }; |
266 | 266 | ||
267 | class Folder : public AkonadiDomainType { | 267 | class Folder : public ApplicationDomainType { |
268 | }; | 268 | }; |
269 | 269 | ||
270 | /** | 270 | /** |
@@ -331,7 +331,7 @@ template<class DomainType> | |||
331 | class StoreFacade { | 331 | class StoreFacade { |
332 | public: | 332 | public: |
333 | virtual ~StoreFacade(){}; | 333 | virtual ~StoreFacade(){}; |
334 | QByteArray type() const { return Domain::getTypeName<DomainType>(); } | 334 | QByteArray type() const { return ApplicationDomain::getTypeName<DomainType>(); } |
335 | virtual Async::Job<void> create(const DomainType &domainObject) = 0; | 335 | virtual Async::Job<void> create(const DomainType &domainObject) = 0; |
336 | virtual Async::Job<void> modify(const DomainType &domainObject) = 0; | 336 | virtual Async::Job<void> modify(const DomainType &domainObject) = 0; |
337 | virtual Async::Job<void> remove(const DomainType &domainObject) = 0; | 337 | virtual Async::Job<void> remove(const DomainType &domainObject) = 0; |
@@ -362,7 +362,7 @@ public: | |||
362 | template<class DomainType, class Facade> | 362 | template<class DomainType, class Facade> |
363 | void registerFacade(const QByteArray &resource) | 363 | void registerFacade(const QByteArray &resource) |
364 | { | 364 | { |
365 | const QByteArray typeName = Domain::getTypeName<DomainType>(); | 365 | const QByteArray typeName = ApplicationDomain::getTypeName<DomainType>(); |
366 | mFacadeRegistry.insert(key(resource, typeName), [](){ return new Facade; }); | 366 | mFacadeRegistry.insert(key(resource, typeName), [](){ return new Facade; }); |
367 | } | 367 | } |
368 | 368 | ||
@@ -378,14 +378,14 @@ public: | |||
378 | template<class DomainType, class Facade> | 378 | template<class DomainType, class Facade> |
379 | void registerFacade(const QByteArray &resource, const std::function<void*(void)> &customFactoryFunction) | 379 | void registerFacade(const QByteArray &resource, const std::function<void*(void)> &customFactoryFunction) |
380 | { | 380 | { |
381 | const QByteArray typeName = Domain::getTypeName<DomainType>(); | 381 | const QByteArray typeName = ApplicationDomain::getTypeName<DomainType>(); |
382 | mFacadeRegistry.insert(key(resource, typeName), customFactoryFunction); | 382 | mFacadeRegistry.insert(key(resource, typeName), customFactoryFunction); |
383 | } | 383 | } |
384 | 384 | ||
385 | template<class DomainType> | 385 | template<class DomainType> |
386 | QSharedPointer<StoreFacade<DomainType> > getFacade(const QByteArray &resource) | 386 | QSharedPointer<StoreFacade<DomainType> > getFacade(const QByteArray &resource) |
387 | { | 387 | { |
388 | const QByteArray typeName = Domain::getTypeName<DomainType>(); | 388 | const QByteArray typeName = ApplicationDomain::getTypeName<DomainType>(); |
389 | auto factoryFunction = mFacadeRegistry.value(key(resource, typeName)); | 389 | auto factoryFunction = mFacadeRegistry.value(key(resource, typeName)); |
390 | if (factoryFunction) { | 390 | if (factoryFunction) { |
391 | return QSharedPointer<StoreFacade<DomainType> >(static_cast<StoreFacade<DomainType>* >(factoryFunction())); | 391 | return QSharedPointer<StoreFacade<DomainType> >(static_cast<StoreFacade<DomainType>* >(factoryFunction())); |
diff --git a/common/domain/event.fbs b/common/domain/event.fbs index 49ff270..0c6628b 100644 --- a/common/domain/event.fbs +++ b/common/domain/event.fbs | |||
@@ -1,4 +1,4 @@ | |||
1 | namespace Akonadi2.Domain.Buffer; | 1 | namespace Akonadi2.ApplicationDomain.Buffer; |
2 | 2 | ||
3 | table Event { | 3 | table Event { |
4 | uid:string; | 4 | uid:string; |
diff --git a/common/domainadaptor.h b/common/domainadaptor.h index 692c8c1..df3f8e5 100644 --- a/common/domainadaptor.h +++ b/common/domainadaptor.h | |||
@@ -68,8 +68,8 @@ class DomainTypeAdaptorFactory/* <typename DomainType, LocalBuffer, ResourceBuff | |||
68 | { | 68 | { |
69 | public: | 69 | public: |
70 | virtual ~DomainTypeAdaptorFactory() {}; | 70 | virtual ~DomainTypeAdaptorFactory() {}; |
71 | virtual QSharedPointer<Akonadi2::Domain::BufferAdaptor> createAdaptor(const Akonadi2::Entity &entity) = 0; | 71 | virtual QSharedPointer<Akonadi2::ApplicationDomain::BufferAdaptor> createAdaptor(const Akonadi2::Entity &entity) = 0; |
72 | virtual void createBuffer(const Akonadi2::Domain::Event &event, flatbuffers::FlatBufferBuilder &fbb) {}; | 72 | virtual void createBuffer(const Akonadi2::ApplicationDomain::Event &event, flatbuffers::FlatBufferBuilder &fbb) {}; |
73 | 73 | ||
74 | protected: | 74 | protected: |
75 | QSharedPointer<PropertyMapper<LocalBuffer> > mLocalMapper; | 75 | QSharedPointer<PropertyMapper<LocalBuffer> > mLocalMapper; |
diff --git a/common/test/clientapitest.cpp b/common/test/clientapitest.cpp index c9e4d6d..24b3fb9 100644 --- a/common/test/clientapitest.cpp +++ b/common/test/clientapitest.cpp | |||
@@ -4,14 +4,14 @@ | |||
4 | 4 | ||
5 | #include "../clientapi.h" | 5 | #include "../clientapi.h" |
6 | 6 | ||
7 | class DummyResourceFacade : public Akonadi2::StoreFacade<Akonadi2::Domain::Event> | 7 | class DummyResourceFacade : public Akonadi2::StoreFacade<Akonadi2::ApplicationDomain::Event> |
8 | { | 8 | { |
9 | public: | 9 | public: |
10 | ~DummyResourceFacade(){}; | 10 | ~DummyResourceFacade(){}; |
11 | virtual Async::Job<void> create(const Akonadi2::Domain::Event &domainObject){ return Async::null<void>(); }; | 11 | virtual Async::Job<void> create(const Akonadi2::ApplicationDomain::Event &domainObject){ return Async::null<void>(); }; |
12 | virtual Async::Job<void> modify(const Akonadi2::Domain::Event &domainObject){ return Async::null<void>(); }; | 12 | virtual Async::Job<void> modify(const Akonadi2::ApplicationDomain::Event &domainObject){ return Async::null<void>(); }; |
13 | virtual Async::Job<void> remove(const Akonadi2::Domain::Event &domainObject){ return Async::null<void>(); }; | 13 | virtual Async::Job<void> remove(const Akonadi2::ApplicationDomain::Event &domainObject){ return Async::null<void>(); }; |
14 | virtual Async::Job<void> load(const Akonadi2::Query &query, const std::function<void(const Akonadi2::Domain::Event::Ptr &)> &resultCallback) | 14 | virtual Async::Job<void> load(const Akonadi2::Query &query, const std::function<void(const Akonadi2::ApplicationDomain::Event::Ptr &)> &resultCallback) |
15 | { | 15 | { |
16 | return Async::start<void>([this, resultCallback](Async::Future<void> &future) { | 16 | return Async::start<void>([this, resultCallback](Async::Future<void> &future) { |
17 | qDebug() << "load called"; | 17 | qDebug() << "load called"; |
@@ -22,7 +22,7 @@ public: | |||
22 | }); | 22 | }); |
23 | } | 23 | } |
24 | 24 | ||
25 | QList<Akonadi2::Domain::Event::Ptr> results; | 25 | QList<Akonadi2::ApplicationDomain::Event::Ptr> results; |
26 | }; | 26 | }; |
27 | 27 | ||
28 | class ClientAPITest : public QObject | 28 | class ClientAPITest : public QObject |
@@ -33,14 +33,14 @@ private Q_SLOTS: | |||
33 | void testLoad() | 33 | void testLoad() |
34 | { | 34 | { |
35 | DummyResourceFacade facade; | 35 | DummyResourceFacade facade; |
36 | facade.results << QSharedPointer<Akonadi2::Domain::Event>::create("resource", "id", 0, QSharedPointer<Akonadi2::Domain::BufferAdaptor>()); | 36 | facade.results << QSharedPointer<Akonadi2::ApplicationDomain::Event>::create("resource", "id", 0, QSharedPointer<Akonadi2::ApplicationDomain::BufferAdaptor>()); |
37 | 37 | ||
38 | Akonadi2::FacadeFactory::instance().registerFacade<Akonadi2::Domain::Event, DummyResourceFacade>("dummyresource", [facade](){ return new DummyResourceFacade(facade); }); | 38 | Akonadi2::FacadeFactory::instance().registerFacade<Akonadi2::ApplicationDomain::Event, DummyResourceFacade>("dummyresource", [facade](){ return new DummyResourceFacade(facade); }); |
39 | 39 | ||
40 | Akonadi2::Query query; | 40 | Akonadi2::Query query; |
41 | query.resources << "dummyresource"; | 41 | query.resources << "dummyresource"; |
42 | 42 | ||
43 | async::SyncListResult<Akonadi2::Domain::Event::Ptr> result(Akonadi2::Store::load<Akonadi2::Domain::Event>(query)); | 43 | async::SyncListResult<Akonadi2::ApplicationDomain::Event::Ptr> result(Akonadi2::Store::load<Akonadi2::ApplicationDomain::Event>(query)); |
44 | result.exec(); | 44 | result.exec(); |
45 | QCOMPARE(result.size(), 1); | 45 | QCOMPARE(result.size(), 1); |
46 | } | 46 | } |