summaryrefslogtreecommitdiffstats
path: root/common/domain/event.h
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2015-05-31 20:16:23 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2015-05-31 20:16:23 +0200
commite297fb92c2c0e344d36e0aef57921f6b9b921a61 (patch)
treeab36c3a121f3f132235ed3eafb5eb5d767c77b3b /common/domain/event.h
parent0815156ef93cb9f48073a777b888ed47b579d695 (diff)
downloadsink-e297fb92c2c0e344d36e0aef57921f6b9b921a61.tar.gz
sink-e297fb92c2c0e344d36e0aef57921f6b9b921a61.zip
Moved default read/write property mapper to TypeImplementation
There is always exactly one default buffer that we can centralize in TypeImplementation.
Diffstat (limited to 'common/domain/event.h')
-rw-r--r--common/domain/event.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/common/domain/event.h b/common/domain/event.h
index 4cb0d34..d4ce20e 100644
--- a/common/domain/event.h
+++ b/common/domain/event.h
@@ -23,23 +23,34 @@
23class ResultSet; 23class ResultSet;
24class QByteArray; 24class QByteArray;
25 25
26template<typename T>
27class ReadPropertyMapper;
28template<typename T>
29class WritePropertyMapper;
30
26namespace Akonadi2 { 31namespace Akonadi2 {
27 class Query; 32 class Query;
28 33
29namespace ApplicationDomain { 34namespace ApplicationDomain {
35 namespace Buffer {
36 class Event;
37 class EventBuilder;
38 }
30 39
31/** 40/**
32 * Implements all type-specific code such as updating and querying indexes. 41 * Implements all type-specific code such as updating and querying indexes.
33 */ 42 */
34namespace EventImplementation { 43template<>
35 typedef Event DomainType; 44struct TypeImplementation<Akonadi2::ApplicationDomain::Event> {
36 /** 45 /**
37 * Returns the potential result set based on the indexes. 46 * Returns the potential result set based on the indexes.
38 * 47 *
39 * An empty result set indicates that a full scan is required. 48 * An empty result set indicates that a full scan is required.
40 */ 49 */
41 ResultSet queryIndexes(const Akonadi2::Query &query, const QByteArray &resourceInstanceIdentifier); 50 static ResultSet queryIndexes(const Akonadi2::Query &query, const QByteArray &resourceInstanceIdentifier);
42 void index(const Event &type); 51 static void index(const Event &type);
52 static QSharedPointer<ReadPropertyMapper<Akonadi2::ApplicationDomain::Buffer::Event> > initializeReadPropertyMapper();
53 static QSharedPointer<WritePropertyMapper<Akonadi2::ApplicationDomain::Buffer::EventBuilder> > initializeWritePropertyMapper();
43}; 54};
44 55
45} 56}