diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-02-22 14:55:16 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-02-22 14:55:16 +0100 |
commit | 7748c2a5c1cc29a8c69ea051174e31b02af4a208 (patch) | |
tree | 80e094dbc83b0fcff3dc7996d5159a349b57ea3f /common/query.h | |
parent | 78a299efd28792364b518e954cc3ae83769e06ab (diff) | |
download | sink-7748c2a5c1cc29a8c69ea051174e31b02af4a208.tar.gz sink-7748c2a5c1cc29a8c69ea051174e31b02af4a208.zip |
Some helper functions to avoid hardcoding collected property names
Diffstat (limited to 'common/query.h')
-rw-r--r-- | common/query.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/common/query.h b/common/query.h index fd79105..9030d7c 100644 --- a/common/query.h +++ b/common/query.h | |||
@@ -234,6 +234,13 @@ public: | |||
234 | return *this; | 234 | return *this; |
235 | } | 235 | } |
236 | 236 | ||
237 | template <typename T> | ||
238 | Reduce &collect() | ||
239 | { | ||
240 | aggregators << Aggregator(QByteArray{T::name} + QByteArray{"Collected"}, Aggregator::Collect, T::name); | ||
241 | return *this; | ||
242 | } | ||
243 | |||
237 | //Reduce on property | 244 | //Reduce on property |
238 | QByteArray property; | 245 | QByteArray property; |
239 | Selector selector; | 246 | Selector selector; |