From bb624c5ec2ab2e13dedcba67fd60e3d2f03216d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20Knau=C3=9F?= Date: Wed, 11 Jan 2017 13:06:55 +0100 Subject: Add Contact as new domain type --- common/domain/contact.h | 57 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 common/domain/contact.h (limited to 'common/domain/contact.h') diff --git a/common/domain/contact.h b/common/domain/contact.h new file mode 100644 index 0000000..c803a9f --- /dev/null +++ b/common/domain/contact.h @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2017 Sandro Knauß + * + * 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 "applicationdomaintype.h" + +class QByteArray; + +template +class ReadPropertyMapper; +template +class WritePropertyMapper; +class IndexPropertyMapper; + +class TypeIndex; + +namespace Sink { +namespace ApplicationDomain { + namespace Buffer { + struct Contact; + struct ContactBuilder; + } + +/** + * Implements all type-specific code such as updating and querying indexes. + * + * These are type specifiy default implementations. Theoretically a resource could implement it's own implementation. + */ +template<> +class TypeImplementation { +public: + typedef Sink::ApplicationDomain::Buffer::Contact Buffer; + typedef Sink::ApplicationDomain::Buffer::ContactBuilder BufferBuilder; + static void configure(TypeIndex &); + static void configure(ReadPropertyMapper &); + static void configure(WritePropertyMapper &); + static void configure(IndexPropertyMapper &indexPropertyMapper); +}; + +} +} -- cgit v1.2.3