diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-05-31 20:16:23 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-05-31 20:16:23 +0200 |
commit | e297fb92c2c0e344d36e0aef57921f6b9b921a61 (patch) | |
tree | ab36c3a121f3f132235ed3eafb5eb5d767c77b3b /common/domain/event.h | |
parent | 0815156ef93cb9f48073a777b888ed47b579d695 (diff) | |
download | sink-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.h | 19 |
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 @@ | |||
23 | class ResultSet; | 23 | class ResultSet; |
24 | class QByteArray; | 24 | class QByteArray; |
25 | 25 | ||
26 | template<typename T> | ||
27 | class ReadPropertyMapper; | ||
28 | template<typename T> | ||
29 | class WritePropertyMapper; | ||
30 | |||
26 | namespace Akonadi2 { | 31 | namespace Akonadi2 { |
27 | class Query; | 32 | class Query; |
28 | 33 | ||
29 | namespace ApplicationDomain { | 34 | namespace 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 | */ |
34 | namespace EventImplementation { | 43 | template<> |
35 | typedef Event DomainType; | 44 | struct 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 | } |