summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2018-02-21 14:07:57 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-02-21 14:08:27 +0100
commit17f0dd179e9fd57b41b29abe84e7e49f9a7ac8a8 (patch)
treec8d8fdf364769747cb2e82a6010037b34d24b679 /common
parentacf28d6f734402202be4404086e20d2739466aa8 (diff)
downloadsink-17f0dd179e9fd57b41b29abe84e7e49f9a7ac8a8.tar.gz
sink-17f0dd179e9fd57b41b29abe84e7e49f9a7ac8a8.zip
Support reductions in the list command
Diffstat (limited to 'common')
-rw-r--r--common/query.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/common/query.h b/common/query.h
index 1e7b41d..fd79105 100644
--- a/common/query.h
+++ b/common/query.h
@@ -247,14 +247,19 @@ public:
247 //Potentially pass-in an identifier under which the result will be available in the result set. 247 //Potentially pass-in an identifier under which the result will be available in the result set.
248 }; 248 };
249 249
250 template <typename T> 250 Reduce &reduce(const QByteArray &name, const Reduce::Selector &s)
251 Reduce &reduce(const Reduce::Selector &s)
252 { 251 {
253 auto reduction = QSharedPointer<Reduce>::create(T::name, s); 252 auto reduction = QSharedPointer<Reduce>::create(name, s);
254 mFilterStages << reduction; 253 mFilterStages << reduction;
255 return *reduction; 254 return *reduction;
256 } 255 }
257 256
257 template <typename T>
258 Reduce &reduce(const Reduce::Selector &s)
259 {
260 return reduce(T::name, s);
261 }
262
258 /** 263 /**
259 * "Bloom" on a property. 264 * "Bloom" on a property.
260 * 265 *