diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-04-28 11:48:06 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-04-28 11:48:06 +0200 |
commit | 6b8432a5c0647d8fbe3cda549574ae13e07bb2f4 (patch) | |
tree | 12b86a325be07013b3f1a926174d554afc35830a /common/domain | |
parent | 4db017949e6528867963c5495aa557dcfb6f4765 (diff) | |
download | sink-6b8432a5c0647d8fbe3cda549574ae13e07bb2f4.tar.gz sink-6b8432a5c0647d8fbe3cda549574ae13e07bb2f4.zip |
Simplified propertymapper
Diffstat (limited to 'common/domain')
-rw-r--r-- | common/domain/typeimplementations.cpp | 10 | ||||
-rw-r--r-- | common/domain/typeimplementations.h | 11 |
2 files changed, 10 insertions, 11 deletions
diff --git a/common/domain/typeimplementations.cpp b/common/domain/typeimplementations.cpp index eb3851e..5db35b7 100644 --- a/common/domain/typeimplementations.cpp +++ b/common/domain/typeimplementations.cpp | |||
@@ -61,7 +61,7 @@ void TypeImplementation<Mail>::configure(IndexPropertyMapper &indexPropertyMappe | |||
61 | }); | 61 | }); |
62 | } | 62 | } |
63 | 63 | ||
64 | void TypeImplementation<Mail>::configure(ReadPropertyMapper<Buffer> &propertyMapper) | 64 | void TypeImplementation<Mail>::configure(ReadPropertyMapper &propertyMapper) |
65 | { | 65 | { |
66 | propertyMapper.addMapping<Mail::Sender, Buffer>(&Buffer::sender); | 66 | propertyMapper.addMapping<Mail::Sender, Buffer>(&Buffer::sender); |
67 | propertyMapper.addMapping<Mail::To, Buffer>(&Buffer::to); | 67 | propertyMapper.addMapping<Mail::To, Buffer>(&Buffer::to); |
@@ -108,7 +108,7 @@ void TypeImplementation<Folder>::configure(TypeIndex &index) | |||
108 | index.addProperty<QString>(Folder::Name::name); | 108 | index.addProperty<QString>(Folder::Name::name); |
109 | } | 109 | } |
110 | 110 | ||
111 | void TypeImplementation<Folder>::configure(ReadPropertyMapper<Buffer> &propertyMapper) | 111 | void TypeImplementation<Folder>::configure(ReadPropertyMapper &propertyMapper) |
112 | { | 112 | { |
113 | propertyMapper.addMapping<Folder::Parent, Buffer>(&Buffer::parent); | 113 | propertyMapper.addMapping<Folder::Parent, Buffer>(&Buffer::parent); |
114 | propertyMapper.addMapping<Folder::Name, Buffer>(&Buffer::name); | 114 | propertyMapper.addMapping<Folder::Name, Buffer>(&Buffer::name); |
@@ -137,7 +137,7 @@ void TypeImplementation<Contact>::configure(TypeIndex &index) | |||
137 | index.addProperty<QByteArray>(Contact::Uid::name); | 137 | index.addProperty<QByteArray>(Contact::Uid::name); |
138 | } | 138 | } |
139 | 139 | ||
140 | void TypeImplementation<Contact>::configure(ReadPropertyMapper<Buffer> &propertyMapper) | 140 | void TypeImplementation<Contact>::configure(ReadPropertyMapper &propertyMapper) |
141 | { | 141 | { |
142 | propertyMapper.addMapping<Contact::Uid, Buffer>(&Buffer::uid); | 142 | propertyMapper.addMapping<Contact::Uid, Buffer>(&Buffer::uid); |
143 | propertyMapper.addMapping<Contact::Fn, Buffer>(&Buffer::fn); | 143 | propertyMapper.addMapping<Contact::Fn, Buffer>(&Buffer::fn); |
@@ -171,7 +171,7 @@ void TypeImplementation<Addressbook>::configure(TypeIndex &index) | |||
171 | index.addProperty<QString>(Addressbook::Name::name); | 171 | index.addProperty<QString>(Addressbook::Name::name); |
172 | } | 172 | } |
173 | 173 | ||
174 | void TypeImplementation<Addressbook>::configure(ReadPropertyMapper<Buffer> &propertyMapper) | 174 | void TypeImplementation<Addressbook>::configure(ReadPropertyMapper &propertyMapper) |
175 | { | 175 | { |
176 | propertyMapper.addMapping<Addressbook::Parent, Buffer>(&Buffer::parent); | 176 | propertyMapper.addMapping<Addressbook::Parent, Buffer>(&Buffer::parent); |
177 | propertyMapper.addMapping<Addressbook::Name, Buffer>(&Buffer::name); | 177 | propertyMapper.addMapping<Addressbook::Name, Buffer>(&Buffer::name); |
@@ -194,7 +194,7 @@ void TypeImplementation<Event>::configure(TypeIndex &index) | |||
194 | index.addProperty<QByteArray>(Event::Uid::name); | 194 | index.addProperty<QByteArray>(Event::Uid::name); |
195 | } | 195 | } |
196 | 196 | ||
197 | void TypeImplementation<Event>::configure(ReadPropertyMapper<Buffer> &propertyMapper) | 197 | void TypeImplementation<Event>::configure(ReadPropertyMapper &propertyMapper) |
198 | { | 198 | { |
199 | propertyMapper.addMapping<Event::Summary, Buffer>(&Buffer::summary); | 199 | propertyMapper.addMapping<Event::Summary, Buffer>(&Buffer::summary); |
200 | propertyMapper.addMapping<Event::Description, Buffer>(&Buffer::description); | 200 | propertyMapper.addMapping<Event::Description, Buffer>(&Buffer::description); |
diff --git a/common/domain/typeimplementations.h b/common/domain/typeimplementations.h index 37d6ca9..705b059 100644 --- a/common/domain/typeimplementations.h +++ b/common/domain/typeimplementations.h | |||
@@ -26,7 +26,6 @@ | |||
26 | #include "contact_generated.h" | 26 | #include "contact_generated.h" |
27 | #include "addressbook_generated.h" | 27 | #include "addressbook_generated.h" |
28 | 28 | ||
29 | template<typename T> | ||
30 | class ReadPropertyMapper; | 29 | class ReadPropertyMapper; |
31 | template<typename T> | 30 | template<typename T> |
32 | class WritePropertyMapper; | 31 | class WritePropertyMapper; |
@@ -48,7 +47,7 @@ public: | |||
48 | typedef Sink::ApplicationDomain::Buffer::Mail Buffer; | 47 | typedef Sink::ApplicationDomain::Buffer::Mail Buffer; |
49 | typedef Sink::ApplicationDomain::Buffer::MailBuilder BufferBuilder; | 48 | typedef Sink::ApplicationDomain::Buffer::MailBuilder BufferBuilder; |
50 | static void configure(TypeIndex &index); | 49 | static void configure(TypeIndex &index); |
51 | static void configure(ReadPropertyMapper<Buffer> &propertyMapper); | 50 | static void configure(ReadPropertyMapper &propertyMapper); |
52 | static void configure(WritePropertyMapper<BufferBuilder> &propertyMapper); | 51 | static void configure(WritePropertyMapper<BufferBuilder> &propertyMapper); |
53 | static void configure(IndexPropertyMapper &indexPropertyMapper); | 52 | static void configure(IndexPropertyMapper &indexPropertyMapper); |
54 | }; | 53 | }; |
@@ -59,7 +58,7 @@ public: | |||
59 | typedef Sink::ApplicationDomain::Buffer::Folder Buffer; | 58 | typedef Sink::ApplicationDomain::Buffer::Folder Buffer; |
60 | typedef Sink::ApplicationDomain::Buffer::FolderBuilder BufferBuilder; | 59 | typedef Sink::ApplicationDomain::Buffer::FolderBuilder BufferBuilder; |
61 | static void configure(TypeIndex &); | 60 | static void configure(TypeIndex &); |
62 | static void configure(ReadPropertyMapper<Buffer> &); | 61 | static void configure(ReadPropertyMapper &); |
63 | static void configure(WritePropertyMapper<BufferBuilder> &); | 62 | static void configure(WritePropertyMapper<BufferBuilder> &); |
64 | static void configure(IndexPropertyMapper &indexPropertyMapper); | 63 | static void configure(IndexPropertyMapper &indexPropertyMapper); |
65 | }; | 64 | }; |
@@ -70,7 +69,7 @@ public: | |||
70 | typedef Sink::ApplicationDomain::Buffer::Contact Buffer; | 69 | typedef Sink::ApplicationDomain::Buffer::Contact Buffer; |
71 | typedef Sink::ApplicationDomain::Buffer::ContactBuilder BufferBuilder; | 70 | typedef Sink::ApplicationDomain::Buffer::ContactBuilder BufferBuilder; |
72 | static void configure(TypeIndex &); | 71 | static void configure(TypeIndex &); |
73 | static void configure(ReadPropertyMapper<Buffer> &); | 72 | static void configure(ReadPropertyMapper &); |
74 | static void configure(WritePropertyMapper<BufferBuilder> &); | 73 | static void configure(WritePropertyMapper<BufferBuilder> &); |
75 | static void configure(IndexPropertyMapper &indexPropertyMapper); | 74 | static void configure(IndexPropertyMapper &indexPropertyMapper); |
76 | }; | 75 | }; |
@@ -81,7 +80,7 @@ public: | |||
81 | typedef Sink::ApplicationDomain::Buffer::Addressbook Buffer; | 80 | typedef Sink::ApplicationDomain::Buffer::Addressbook Buffer; |
82 | typedef Sink::ApplicationDomain::Buffer::AddressbookBuilder BufferBuilder; | 81 | typedef Sink::ApplicationDomain::Buffer::AddressbookBuilder BufferBuilder; |
83 | static void configure(TypeIndex &); | 82 | static void configure(TypeIndex &); |
84 | static void configure(ReadPropertyMapper<Buffer> &); | 83 | static void configure(ReadPropertyMapper &); |
85 | static void configure(WritePropertyMapper<BufferBuilder> &); | 84 | static void configure(WritePropertyMapper<BufferBuilder> &); |
86 | static void configure(IndexPropertyMapper &indexPropertyMapper); | 85 | static void configure(IndexPropertyMapper &indexPropertyMapper); |
87 | }; | 86 | }; |
@@ -92,7 +91,7 @@ public: | |||
92 | typedef Sink::ApplicationDomain::Buffer::Event Buffer; | 91 | typedef Sink::ApplicationDomain::Buffer::Event Buffer; |
93 | typedef Sink::ApplicationDomain::Buffer::EventBuilder BufferBuilder; | 92 | typedef Sink::ApplicationDomain::Buffer::EventBuilder BufferBuilder; |
94 | static void configure(TypeIndex &); | 93 | static void configure(TypeIndex &); |
95 | static void configure(ReadPropertyMapper<Buffer> &); | 94 | static void configure(ReadPropertyMapper &); |
96 | static void configure(WritePropertyMapper<BufferBuilder> &); | 95 | static void configure(WritePropertyMapper<BufferBuilder> &); |
97 | static void configure(IndexPropertyMapper &indexPropertyMapper); | 96 | static void configure(IndexPropertyMapper &indexPropertyMapper); |
98 | }; | 97 | }; |