diff options
Diffstat (limited to 'common/queryrunner.h')
-rw-r--r-- | common/queryrunner.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/common/queryrunner.h b/common/queryrunner.h index 0ee6a81..04e4587 100644 --- a/common/queryrunner.h +++ b/common/queryrunner.h | |||
@@ -32,6 +32,9 @@ | |||
32 | class QueryRunnerBase : public QObject | 32 | class QueryRunnerBase : public QObject |
33 | { | 33 | { |
34 | Q_OBJECT | 34 | Q_OBJECT |
35 | public: | ||
36 | typedef std::function<void(Sink::ApplicationDomain::ApplicationDomainType &domainObject)> ResultTransformation; | ||
37 | |||
35 | protected: | 38 | protected: |
36 | typedef std::function<KAsync::Job<void>()> QueryFunction; | 39 | typedef std::function<KAsync::Job<void>()> QueryFunction; |
37 | 40 | ||
@@ -43,7 +46,6 @@ protected: | |||
43 | queryFunction = query; | 46 | queryFunction = query; |
44 | } | 47 | } |
45 | 48 | ||
46 | |||
47 | protected slots: | 49 | protected slots: |
48 | /** | 50 | /** |
49 | * Rerun query with new revision | 51 | * Rerun query with new revision |
@@ -82,10 +84,17 @@ public: | |||
82 | QueryRunner(const Sink::Query &query, const Sink::ResourceAccessInterface::Ptr &, const QByteArray &instanceIdentifier, const DomainTypeAdaptorFactoryInterface::Ptr &, const QByteArray &bufferType); | 84 | QueryRunner(const Sink::Query &query, const Sink::ResourceAccessInterface::Ptr &, const QByteArray &instanceIdentifier, const DomainTypeAdaptorFactoryInterface::Ptr &, const QByteArray &bufferType); |
83 | virtual ~QueryRunner(); | 85 | virtual ~QueryRunner(); |
84 | 86 | ||
87 | /** | ||
88 | * Allows you to run a transformation on every result. | ||
89 | * This transformation is executed in the query thread. | ||
90 | */ | ||
91 | void setResultTransformation(const ResultTransformation &transformation); | ||
92 | |||
85 | typename Sink::ResultEmitter<typename DomainType::Ptr>::Ptr emitter(); | 93 | typename Sink::ResultEmitter<typename DomainType::Ptr>::Ptr emitter(); |
86 | 94 | ||
87 | private: | 95 | private: |
88 | QSharedPointer<Sink::ResourceAccessInterface> mResourceAccess; | 96 | QSharedPointer<Sink::ResourceAccessInterface> mResourceAccess; |
89 | QSharedPointer<Sink::ResultProvider<typename DomainType::Ptr> > mResultProvider; | 97 | QSharedPointer<Sink::ResultProvider<typename DomainType::Ptr> > mResultProvider; |
98 | ResultTransformation mResultTransformation; | ||
90 | }; | 99 | }; |
91 | 100 | ||