From 110817a23463c71eacbc986af3ae509462758a3c Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sat, 21 Nov 2015 11:07:47 +0100 Subject: Separated DomainTypeAdaptorFactoryInterface --- common/domainadaptor.h | 12 ++------- common/domaintypeadaptorfactoryinterface.h | 42 ++++++++++++++++++++++++++++++ common/facade.cpp | 1 + common/facade.h | 4 ++- 4 files changed, 48 insertions(+), 11 deletions(-) create mode 100644 common/domaintypeadaptorfactoryinterface.h (limited to 'common') diff --git a/common/domainadaptor.h b/common/domainadaptor.h index 620a658..b541e23 100644 --- a/common/domainadaptor.h +++ b/common/domainadaptor.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014 Christian Mollekopf + * Copyright (C) 2014 Christian Mollekopf * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,6 +23,7 @@ #include #include +#include "domaintypeadaptorfactoryinterface.h" #include "domain/applicationdomaintype.h" #include "domain/event.h" #include "domain/mail.h" @@ -124,15 +125,6 @@ public: QSharedPointer > mResourceMapper; }; -class DomainTypeAdaptorFactoryInterface -{ -public: - typedef QSharedPointer Ptr; - virtual ~DomainTypeAdaptorFactoryInterface() {}; - virtual QSharedPointer createAdaptor(const Akonadi2::Entity &entity) = 0; - virtual void createBuffer(const Akonadi2::ApplicationDomain::ApplicationDomainType &domainType, flatbuffers::FlatBufferBuilder &fbb, void const *metadataData = 0, size_t metadataSize = 0) = 0; -}; - /** * The factory should define how to go from an entitybuffer (local + resource buffer), to a domain type adapter. * It defines how values are split accross local and resource buffer. diff --git a/common/domaintypeadaptorfactoryinterface.h b/common/domaintypeadaptorfactoryinterface.h new file mode 100644 index 0000000..8c99aa1 --- /dev/null +++ b/common/domaintypeadaptorfactoryinterface.h @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2014 Christian Mollekopf + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#pragma once + +#include + +namespace Akonadi2 { + namespace ApplicationDomain { + class BufferAdaptor; + class ApplicationDomainType; + } + struct Entity; +} + +namespace flatbuffers { + class FlatBufferBuilder; +} + +class DomainTypeAdaptorFactoryInterface +{ +public: + typedef QSharedPointer Ptr; + virtual ~DomainTypeAdaptorFactoryInterface() {}; + virtual QSharedPointer createAdaptor(const Akonadi2::Entity &entity) = 0; + virtual void createBuffer(const Akonadi2::ApplicationDomain::ApplicationDomainType &domainType, flatbuffers::FlatBufferBuilder &fbb, void const *metadataData = 0, size_t metadataSize = 0) = 0; +}; diff --git a/common/facade.cpp b/common/facade.cpp index f534319..08f7500 100644 --- a/common/facade.cpp +++ b/common/facade.cpp @@ -23,6 +23,7 @@ #include "log.h" #include "storage.h" #include "definitions.h" +#include "domainadaptor.h" using namespace Akonadi2; diff --git a/common/facade.h b/common/facade.h index aa50941..794e35e 100644 --- a/common/facade.h +++ b/common/facade.h @@ -26,9 +26,11 @@ #include "resourceaccess.h" #include "resultset.h" -#include "domainadaptor.h" +#include "domaintypeadaptorfactoryinterface.h" +#include "storage.h" namespace Akonadi2 { + /** * Default facade implementation for resources that are implemented in a separate process using the ResourceAccess class. * -- cgit v1.2.3