@@ -2178,7 +2178,7 @@ class dataflow {
2178
2178
/* *
2179
2179
* @brief Initiate a cutflow.
2180
2180
* @tparam Col Column type.
2181
- * @param[in] column Input column value used as cut decision.
2181
+ * @param[in] column Input column used as cut decision.
2182
2182
* @return Lazy selection.
2183
2183
*/
2184
2184
template <typename Col>
@@ -2187,7 +2187,7 @@ class dataflow {
2187
2187
/* *
2188
2188
* @brief Initiate a cutflow.
2189
2189
* @tparam Col Column type.
2190
- * @param[in] column Input column value used as weight decision.
2190
+ * @param[in] column Input column used as weight decision.
2191
2191
* @return Lazy selection.
2192
2192
*/
2193
2193
template <typename Col>
@@ -2196,15 +2196,15 @@ class dataflow {
2196
2196
/* *
2197
2197
* @brief Initiate a cutflow.
2198
2198
* @tparam Col Lazy varied column.
2199
- * @param[in] column Input column value used as cut decision.
2199
+ * @param[in] column Input column used as cut decision.
2200
2200
* @return Lazy varied selection.
2201
2201
*/
2202
2202
template <typename Col> auto filter (Col const &col);
2203
2203
2204
2204
/* *
2205
2205
* @brief Initiate a cutflow.
2206
2206
* @tparam Col Lazy varied column.
2207
- * @param[in] column Input column value used as weight decision.
2207
+ * @param[in] column Input column used as weight decision.
2208
2208
* @return Lazy varied selection.
2209
2209
*/
2210
2210
template <typename Col> auto weight (Col const &col);
@@ -2845,39 +2845,113 @@ class lazy : public dataflow::node,
2845
2845
std::enable_if_t <queryosity::is_column_v<V>, bool > = false >
2846
2846
auto to () const -> lazy<column::valued<To>>;
2847
2847
2848
- template <typename Col> auto filter (lazy<Col> const &col) const ;
2849
- template <typename Col> auto weight (lazy<Col> const &col) const ;
2848
+ /* *
2849
+ * @brief Compound a weight to from this selection.
2850
+ * @tparam Col Column type.
2851
+ * @param[in] column Input lazy column used as weight decision.
2852
+ * @details The current selection becomes its prerequisite in the cutflow: all
2853
+ * prerequisites must pass in order for a downstream selection to pass.
2854
+ * @return Compounded lazy weight.
2855
+ */
2856
+ template <typename Col> auto filter (lazy<Col> const &column) const ;
2857
+
2858
+ /* *
2859
+ * @brief Compound a weight to from this selection.
2860
+ * @tparam Col Column type.
2861
+ * @param[in] column Input lazy column used as weight decision.
2862
+ * @return Compounded lazy weight.
2863
+ */
2864
+ template <typename Col> auto weight (lazy<Col> const &column) const ;
2865
+
2866
+ /* *
2867
+ * @brief Compound a varied cut to this selection.
2868
+ * @tparam Col Varied lazy column type.
2869
+ * @param[in] column Input varied column used as cut decision.
2870
+ * @return Varied lazy cut.
2871
+ */
2872
+ template <typename Col> auto filter (Col const &column) const ;
2850
2873
2851
- template <typename Col> auto filter (Col const &col) const ;
2852
- template <typename Col> auto weight (Col const &col) const ;
2874
+ /* *
2875
+ * @brief Compound a varied weight to this selection.
2876
+ * @tparam Col Varied lazy column type.
2877
+ * @param[in] column Input varied column used as weight decision.
2878
+ * @return Varied lazy weight.
2879
+ */
2880
+ template <typename Col> auto weight (Col const &column) const ;
2853
2881
2882
+ /* *
2883
+ * @brief Compound a cut to this selection.
2884
+ * @tparam Expr Callable type (C++ function, functor, lambda, etc.).
2885
+ * @param[in] column Input lazy column used as cut decision.
2886
+ * @return Selection evaluator.
2887
+ */
2854
2888
template <typename Expr>
2855
2889
auto filter (queryosity::column::expression<Expr> const &expr) const ;
2856
2890
2891
+ /* *
2892
+ * @brief Compound a weight to from this selection.
2893
+ * @tparam Expr Callable type (C++ function, functor, lambda, etc.).
2894
+ * @param[in] expr Expression used to evaluate the weight decision.
2895
+ * @return Selection evaluator.
2896
+ */
2857
2897
template <typename Expr>
2858
2898
auto weight (queryosity::column::expression<Expr> const &expr) const ;
2859
2899
2860
- template <typename Agg> auto book (Agg &&agg) const ;
2861
- template <typename ... Aggs> auto book (Aggs &&...aggs) const ;
2900
+ /* *
2901
+ * @brief Book a query at this selection.
2902
+ * @tparam Qry (Varied) query booker type.
2903
+ * @param[in] qry Query booker.
2904
+ * @details The query booker should have already been filled with input columns (if applicable).
2905
+ * @return (Varied) lazy query.
2906
+ */
2907
+ template <typename Qry> auto book (Qry &&qry) const ;
2862
2908
2863
2909
/* *
2864
- * @brief Get a column series for the entries passing the selection
2910
+ * @brief Book multiple queries at this selection.
2911
+ * @tparam Qrys (Varied) query booker types.
2912
+ * @param[in] qrys Query bookers.
2913
+ * @details The query bookers should have already been filled with input columns (if applicable).
2914
+ * @return (Varied) lazy queries.
2915
+ */
2916
+ template <typename ... Qrys> auto book (Qrys &&...qrys) const ;
2917
+
2918
+ /* *
2919
+ * @brief Get a column series for the entries passing the selection.
2920
+ * @tparam Col Lazy column type.
2921
+ * @return Lazy query.
2865
2922
* @attention The weight value does not apply in the population of the
2866
2923
* series.
2867
2924
*/
2868
- template <typename Col, std::enable_if_t <queryosity::is_nominal_v<Col>,bool > = false >
2925
+ template <typename Col,
2926
+ std::enable_if_t <queryosity::is_nominal_v<Col>, bool > = false >
2869
2927
auto get (column::series<Col> const &col)
2870
2928
-> lazy<query::series<typename column::series<Col>::value_type>>;
2871
2929
2872
- template <typename Col, std::enable_if_t <queryosity::is_varied_v<Col>,bool > = false >
2873
- auto get (column::series<Col> const &col)
2874
- -> typename lazy<query::series<typename column::series<Col>::value_type>>::varied;
2930
+ /* *
2931
+ * @brief Get a column series for the entries passing the selection.
2932
+ * @tparam Col Varied column type.
2933
+ * @return Varied lazy query.
2934
+ * @attention The weight value does not apply in the population of the
2935
+ * series.
2936
+ */
2937
+ template <typename Col,
2938
+ std::enable_if_t <queryosity::is_varied_v<Col>, bool > = false >
2939
+ auto get (column::series<Col> const &col) -> typename lazy<
2940
+ query::series<typename column::series<Col>::value_type>>::varied;
2875
2941
2942
+ /* *
2943
+ * @brief (Process and) retrieve the result of a query.
2944
+ * @return Query result.
2945
+ * @attention Invoking this turns *all* lazy actions in the dataflow *eager*.
2946
+ */
2876
2947
template <
2877
2948
typename V = Action,
2878
2949
std::enable_if_t <queryosity::query::is_aggregation_v<V>, bool > = false >
2879
2950
auto result () -> decltype(std::declval<V>().result());
2880
2951
2952
+ /* *
2953
+ * @brief Shortcut for `result()`.
2954
+ */
2881
2955
template <
2882
2956
typename V = Action,
2883
2957
std::enable_if_t <queryosity::query::is_aggregation_v<V>, bool > = false >
@@ -2923,9 +2997,11 @@ namespace queryosity {
2923
2997
/* *
2924
2998
* @ingroup api
2925
2999
* @brief Variations of a lazy action.
2926
- * @details A varied lazy node encapsulates independent nominal and variations
2927
- * of a lazy action.
2928
3000
* @tparam Action Action to be performed.
3001
+ * @details A varied lazy action encapsulates independent nominal and variation
3002
+ * instances of of a lazy action, which are implicitly propagated through all
3003
+ * downstream actions that it participates in. In other words, a varied node
3004
+ * behaves functionally identical to a nominal-only one.
2929
3005
*/
2930
3006
template <typename Act>
2931
3007
class lazy <Act>::varied : public dataflow::node,
@@ -2955,12 +3031,21 @@ class lazy<Act>::varied : public dataflow::node,
2955
3031
virtual std::set<std::string> get_variation_names () const override ;
2956
3032
2957
3033
/* *
2958
- * Apply a filter.
3034
+ * @brief Compound a cut to this selection.
3035
+ * @Col (Varied) lazy input column type.
3036
+ * @parma[in] col (Varied) lazy input column used as cut decision.
3037
+ * @return Varied lazy selection.
2959
3038
*/
2960
3039
template <typename Col, typename V = Act,
2961
3040
std::enable_if_t <queryosity::is_selection_v<V>, bool > = false >
2962
3041
auto filter (Col const &col) -> typename lazy<selection::node>::varied;
2963
3042
3043
+ /* *
3044
+ * @brief Compound a weight to this selection.
3045
+ * @Col (Varied) lazy input column type.
3046
+ * @parma[in] col (Varied) lazy input column used as cut decision.
3047
+ * @return Varied lazy selection.
3048
+ */
2964
3049
template <typename Col, typename V = Act,
2965
3050
std::enable_if_t <queryosity::is_selection_v<V>, bool > = false >
2966
3051
auto weight (Col const &col) -> typename lazy<selection::node>::varied;
@@ -3107,8 +3192,8 @@ auto queryosity::lazy<Act>::varied::filter(
3107
3192
typename todo<selection::applicator<selection::cut,
3108
3193
column::equation_t <Expr>>>::varied {
3109
3194
3110
- using varied_type = typename todo<selection::applicator<selection::cut,
3111
- column::equation_t <Expr>>>::varied;
3195
+ using varied_type = typename todo<
3196
+ selection::applicator<selection::cut, column::equation_t <Expr>>>::varied;
3112
3197
3113
3198
auto syst = varied_type (this ->nominal ().filter (expr));
3114
3199
@@ -3126,8 +3211,9 @@ auto queryosity::lazy<Act>::varied::weight(
3126
3211
typename todo<selection::applicator<selection::weight,
3127
3212
column::equation_t <Expr>>>::varied {
3128
3213
3129
- using varied_type = typename todo<selection::applicator<selection::weight,
3130
- column::equation_t <Expr>>>::varied;
3214
+ using varied_type =
3215
+ typename todo<selection::applicator<selection::weight,
3216
+ column::equation_t <Expr>>>::varied;
3131
3217
3132
3218
auto syst = varied_type (this ->nominal ().weight (expr));
3133
3219
@@ -3579,32 +3665,33 @@ auto queryosity::lazy<Action>::weight(
3579
3665
}
3580
3666
3581
3667
template <typename Action>
3582
- template <typename Agg >
3583
- auto queryosity::lazy<Action>::book(Agg &&agg ) const {
3668
+ template <typename Qry >
3669
+ auto queryosity::lazy<Action>::book(Qry &&qry ) const {
3584
3670
static_assert (std::is_base_of_v<selection::node, Action>,
3585
3671
" book must be called from a selection" );
3586
- return agg .at (*this );
3672
+ return qry .at (*this );
3587
3673
}
3588
3674
3589
3675
template <typename Action>
3590
- template <typename ... Aggs >
3591
- auto queryosity::lazy<Action>::book(Aggs &&...aggs ) const {
3676
+ template <typename ... Qrys >
3677
+ auto queryosity::lazy<Action>::book(Qrys &&...qrys ) const {
3592
3678
static_assert (std::is_base_of_v<selection::node, Action>,
3593
3679
" book must be called from a selection" );
3594
- return std::make_tuple ((aggs .at (*this ), ...));
3680
+ return std::make_tuple ((qrys .at (*this ), ...));
3595
3681
}
3596
3682
3597
3683
template <typename Action>
3598
- template <typename Col, std::enable_if_t <queryosity::is_nominal_v<Col>,bool >>
3684
+ template <typename Col, std::enable_if_t <queryosity::is_nominal_v<Col>, bool >>
3599
3685
auto queryosity::lazy<Action>::get(queryosity::column::series<Col> const &col)
3600
3686
-> lazy<query::series<typename column::series<Col>::value_type>> {
3601
3687
return col.make (*this );
3602
3688
}
3603
3689
3604
3690
template <typename Action>
3605
- template <typename Col, std::enable_if_t <queryosity::is_varied_v<Col>,bool >>
3691
+ template <typename Col, std::enable_if_t <queryosity::is_varied_v<Col>, bool >>
3606
3692
auto queryosity::lazy<Action>::get(queryosity::column::series<Col> const &col)
3607
- -> typename lazy<query::series<typename column::series<Col>::value_type>>::varied {
3693
+ -> typename lazy<
3694
+ query::series<typename column::series<Col>::value_type>>::varied {
3608
3695
return col.make (*this );
3609
3696
}
3610
3697
0 commit comments