diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-01-02 22:39:25 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-01-02 22:39:25 +0100 |
commit | 91d915a09b7d52c10edb1d4c1298fc2885b8a257 (patch) | |
tree | 407e9a2a1c902a68c78a7d08aab80ba47565fa88 /common/pipeline.h | |
parent | 817bff01d15395206c1cc637d0c9ac0905007bf1 (diff) | |
download | sink-91d915a09b7d52c10edb1d4c1298fc2885b8a257.tar.gz sink-91d915a09b7d52c10edb1d4c1298fc2885b8a257.zip |
DomainTypeAdaptor factory, per type preprocessor pipeline configuration.
Diffstat (limited to 'common/pipeline.h')
-rw-r--r-- | common/pipeline.h | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/common/pipeline.h b/common/pipeline.h index 6ef8703..8373899 100644 --- a/common/pipeline.h +++ b/common/pipeline.h | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | #include <akonadi2common_export.h> | 28 | #include <akonadi2common_export.h> |
29 | #include <storage.h> | 29 | #include <storage.h> |
30 | #include <clientapi.h> //For domain types | ||
30 | 31 | ||
31 | namespace Akonadi2 | 32 | namespace Akonadi2 |
32 | { | 33 | { |
@@ -46,12 +47,34 @@ public: | |||
46 | 47 | ||
47 | Storage &storage() const; | 48 | Storage &storage() const; |
48 | 49 | ||
50 | // template <typename T> | ||
51 | // Storage &storage() const; | ||
52 | |||
53 | template <typename T> | ||
54 | void setPreprocessors(Type type, const QVector<Preprocessor *> &preprocessors) | ||
55 | { | ||
56 | setPreprocessors(Akonadi2::Domain::getTypeName<T>(), type, preprocessors); | ||
57 | } | ||
58 | |||
49 | void null(); | 59 | void null(); |
50 | //FIXME We should probably directly provide a DomainTypeAdapter here. The data has already been written and we only need to read it for processing. And we need to read all buffers. | 60 | |
51 | void newEntity(const QByteArray &key, void *resourceBufferData, size_t size); | 61 | template <typename T> |
52 | //TODO Send local buffer data as well? | 62 | void newEntity(const QByteArray &key, void *resourceBufferData, size_t size) |
53 | void modifiedEntity(const QByteArray &key, void *data, size_t size); | 63 | { |
54 | void deletedEntity(const QByteArray &key); | 64 | newEntity(Akonadi2::Domain::getTypeName<T>(), key, resourceBufferData, size); |
65 | } | ||
66 | |||
67 | template <typename T> | ||
68 | void modifiedEntity(const QByteArray &key, void *data, size_t size) | ||
69 | { | ||
70 | modifiedEntity(Akonadi2::Domain::getTypeName<T>(), key, data, size); | ||
71 | } | ||
72 | |||
73 | template <typename T> | ||
74 | void deletedEntity(const QByteArray &key) | ||
75 | { | ||
76 | deletedEntity(Akonadi2::Domain::getTypeName<T>(), key); | ||
77 | } | ||
55 | 78 | ||
56 | Q_SIGNALS: | 79 | Q_SIGNALS: |
57 | void revisionUpdated(); | 80 | void revisionUpdated(); |
@@ -61,6 +84,10 @@ private Q_SLOTS: | |||
61 | void stepPipelines(); | 84 | void stepPipelines(); |
62 | 85 | ||
63 | private: | 86 | private: |
87 | void setPreprocessors(const QString &entityType, Type pipelineType, const QVector<Preprocessor *> &preprocessors); | ||
88 | void newEntity(const QString &entityType, const QByteArray &key, void *resourceBufferData, size_t size); | ||
89 | void modifiedEntity(const QString &entityType, const QByteArray &key, void *data, size_t size); | ||
90 | void deletedEntity(const QString &entityType, const QByteArray &key); | ||
64 | void pipelineStepped(const PipelineState &state); | 91 | void pipelineStepped(const PipelineState &state); |
65 | void pipelineCompleted(const PipelineState &state); | 92 | void pipelineCompleted(const PipelineState &state); |
66 | void scheduleStep(); | 93 | void scheduleStep(); |