From e297fb92c2c0e344d36e0aef57921f6b9b921a61 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sun, 31 May 2015 20:16:23 +0200 Subject: Moved default read/write property mapper to TypeImplementation There is always exactly one default buffer that we can centralize in TypeImplementation. --- common/domain/event.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'common/domain/event.h') 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 @@ class ResultSet; class QByteArray; +template +class ReadPropertyMapper; +template +class WritePropertyMapper; + namespace Akonadi2 { class Query; namespace ApplicationDomain { + namespace Buffer { + class Event; + class EventBuilder; + } /** * Implements all type-specific code such as updating and querying indexes. */ -namespace EventImplementation { - typedef Event DomainType; +template<> +struct TypeImplementation { /** * Returns the potential result set based on the indexes. * * An empty result set indicates that a full scan is required. */ - ResultSet queryIndexes(const Akonadi2::Query &query, const QByteArray &resourceInstanceIdentifier); - void index(const Event &type); + static ResultSet queryIndexes(const Akonadi2::Query &query, const QByteArray &resourceInstanceIdentifier); + static void index(const Event &type); + static QSharedPointer > initializeReadPropertyMapper(); + static QSharedPointer > initializeWritePropertyMapper(); }; } -- cgit v1.2.3