summaryrefslogtreecommitdiffstats
path: root/common/domain
diff options
context:
space:
mode:
Diffstat (limited to 'common/domain')
-rw-r--r--common/domain/event.cpp20
-rw-r--r--common/domain/event.h9
2 files changed, 16 insertions, 13 deletions
diff --git a/common/domain/event.cpp b/common/domain/event.cpp
index ea0931c..776fa50 100644
--- a/common/domain/event.cpp
+++ b/common/domain/event.cpp
@@ -56,28 +56,28 @@ void TypeImplementation<Event>::index(const Event &type)
56 } 56 }
57} 57}
58 58
59QSharedPointer<ReadPropertyMapper<Buffer::Event> > TypeImplementation<Event>::initializeReadPropertyMapper() 59QSharedPointer<ReadPropertyMapper<TypeImplementation<Event>::Buffer> > TypeImplementation<Event>::initializeReadPropertyMapper()
60{ 60{
61 auto propertyMapper = QSharedPointer<ReadPropertyMapper<Buffer::Event> >::create(); 61 auto propertyMapper = QSharedPointer<ReadPropertyMapper<Buffer> >::create();
62 propertyMapper->addMapping("summary", [](Buffer::Event const *buffer) -> QVariant { 62 propertyMapper->addMapping("summary", [](Buffer const *buffer) -> QVariant {
63 return propertyToVariant<QString>(buffer->summary()); 63 return propertyToVariant<QString>(buffer->summary());
64 }); 64 });
65 propertyMapper->addMapping("uid", [](Buffer::Event const *buffer) -> QVariant { 65 propertyMapper->addMapping("uid", [](Buffer const *buffer) -> QVariant {
66 return propertyToVariant<QString>(buffer->uid()); 66 return propertyToVariant<QString>(buffer->uid());
67 }); 67 });
68 return propertyMapper; 68 return propertyMapper;
69} 69}
70 70
71QSharedPointer<WritePropertyMapper<Buffer::EventBuilder> > TypeImplementation<Event>::initializeWritePropertyMapper() 71QSharedPointer<WritePropertyMapper<TypeImplementation<Event>::BufferBuilder> > TypeImplementation<Event>::initializeWritePropertyMapper()
72{ 72{
73 auto propertyMapper = QSharedPointer<WritePropertyMapper<Buffer::EventBuilder> >::create(); 73 auto propertyMapper = QSharedPointer<WritePropertyMapper<BufferBuilder> >::create();
74 propertyMapper->addMapping("summary", [](const QVariant &value, flatbuffers::FlatBufferBuilder &fbb) -> std::function<void(Buffer::EventBuilder &)> { 74 propertyMapper->addMapping("summary", [](const QVariant &value, flatbuffers::FlatBufferBuilder &fbb) -> std::function<void(BufferBuilder &)> {
75 auto offset = variantToProperty<QString>(value, fbb); 75 auto offset = variantToProperty<QString>(value, fbb);
76 return [offset](Buffer::EventBuilder &builder) { builder.add_summary(offset); }; 76 return [offset](BufferBuilder &builder) { builder.add_summary(offset); };
77 }); 77 });
78 propertyMapper->addMapping("uid", [](const QVariant &value, flatbuffers::FlatBufferBuilder &fbb) -> std::function<void(Buffer::EventBuilder &)> { 78 propertyMapper->addMapping("uid", [](const QVariant &value, flatbuffers::FlatBufferBuilder &fbb) -> std::function<void(BufferBuilder &)> {
79 auto offset = variantToProperty<QString>(value, fbb); 79 auto offset = variantToProperty<QString>(value, fbb);
80 return [offset](Buffer::EventBuilder &builder) { builder.add_uid(offset); }; 80 return [offset](BufferBuilder &builder) { builder.add_uid(offset); };
81 }); 81 });
82 return propertyMapper; 82 return propertyMapper;
83} 83}
diff --git a/common/domain/event.h b/common/domain/event.h
index d4ce20e..d40e55d 100644
--- a/common/domain/event.h
+++ b/common/domain/event.h
@@ -41,7 +41,10 @@ namespace ApplicationDomain {
41 * Implements all type-specific code such as updating and querying indexes. 41 * Implements all type-specific code such as updating and querying indexes.
42 */ 42 */
43template<> 43template<>
44struct TypeImplementation<Akonadi2::ApplicationDomain::Event> { 44class TypeImplementation<Akonadi2::ApplicationDomain::Event> {
45public:
46 typedef Akonadi2::ApplicationDomain::Buffer::Event Buffer;
47 typedef Akonadi2::ApplicationDomain::Buffer::EventBuilder BufferBuilder;
45 /** 48 /**
46 * Returns the potential result set based on the indexes. 49 * Returns the potential result set based on the indexes.
47 * 50 *
@@ -49,8 +52,8 @@ struct TypeImplementation<Akonadi2::ApplicationDomain::Event> {
49 */ 52 */
50 static ResultSet queryIndexes(const Akonadi2::Query &query, const QByteArray &resourceInstanceIdentifier); 53 static ResultSet queryIndexes(const Akonadi2::Query &query, const QByteArray &resourceInstanceIdentifier);
51 static void index(const Event &type); 54 static void index(const Event &type);
52 static QSharedPointer<ReadPropertyMapper<Akonadi2::ApplicationDomain::Buffer::Event> > initializeReadPropertyMapper(); 55 static QSharedPointer<ReadPropertyMapper<Buffer> > initializeReadPropertyMapper();
53 static QSharedPointer<WritePropertyMapper<Akonadi2::ApplicationDomain::Buffer::EventBuilder> > initializeWritePropertyMapper(); 56 static QSharedPointer<WritePropertyMapper<BufferBuilder> > initializeWritePropertyMapper();
54}; 57};
55 58
56} 59}