Skip to content

Commit 8392677

Browse files
committed
fixup! refactor inputsFromArgs; update concepts
1 parent 7a70d57 commit 8392677

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

Framework/Core/include/Framework/ASoA.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ template <aod::is_aod_hash L, aod::is_aod_hash D, aod::is_origin_hash O, typenam
10091009
class Table;
10101010

10111011
template <typename T>
1012-
concept is_table = framework::specialization_of_template<soa::Table, std::decay_t<T>> || framework::base_of_template<soa::Table, std::decay_t<T>>;
1012+
concept is_table = framework::specialization_of_template<soa::Table, T> || framework::base_of_template<soa::Table, T>;
10131013

10141014
/// Similar to a pair but not a pair, to avoid
10151015
/// exposing the second type everywhere.
@@ -1232,7 +1232,7 @@ struct ArrowHelpers {
12321232

12331233
//! Helper to check if a type T is an iterator
12341234
template <typename T>
1235-
concept is_iterator = framework::base_of_template<TableIterator, std::decay_t<T>> || framework::specialization_of_template<TableIterator, std::decay_t<T>>;
1235+
concept is_iterator = framework::base_of_template<TableIterator, T> || framework::specialization_of_template<TableIterator, T>;
12361236

12371237
template <typename T>
12381238
concept with_originals = requires {

Framework/Core/include/Framework/AnalysisTask.h

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,10 @@ struct AnalysisDataProcessorBuilder {
176176
}
177177

178178
/// helper to append the inputs and expression information for normalized arguments
179-
template <soa::is_table A, soa::is_table... As>
179+
template <soa::is_table ... As>
180180
static void addInputsAndExpressions(uint32_t hash, const char* name, bool value, std::vector<InputSpec>& inputs, std::vector<ExpressionInfo>& eInfos)
181181
{
182-
int ai = 0;
183-
addExpression<std::decay_t<A>>(ai, hash, eInfos);
184-
addInput<std::decay_t<A>>(name, value, inputs);
185-
182+
int ai = -1;
186183
([&ai, &hash, &eInfos, &name, &value, &inputs]() mutable {
187184
++ai;
188185
using T = std::decay_t<As>;
@@ -193,7 +190,7 @@ struct AnalysisDataProcessorBuilder {
193190
}
194191

195192
/// helper to parse the process arguments
196-
/// 1. enumeration (must be a sole argument)
193+
/// 1. enumeration (must be the only argument)
197194
template <typename R, typename C, is_enumeration A>
198195
static void inputsFromArgs(R (C::*)(A), const char* /*name*/, bool /*value*/, std::vector<InputSpec>& inputs, std::vector<ExpressionInfo>&, std::vector<StringPair>&, std::vector<StringPair>&)
199196
{
@@ -213,12 +210,12 @@ struct AnalysisDataProcessorBuilder {
213210
}
214211

215212
/// 3. generic case
216-
template <typename R, typename C, soa::is_table A, soa::is_table... Args>
217-
static void inputsFromArgs(R (C::*)(A, Args...), const char* name, bool value, std::vector<InputSpec>& inputs, std::vector<ExpressionInfo>& eInfos, std::vector<StringPair>&, std::vector<StringPair>&)
218-
requires(std::is_lvalue_reference_v<A> && (std::is_lvalue_reference_v<Args> && ...))
213+
template <typename R, typename C, soa::is_table... Args>
214+
static void inputsFromArgs(R (C::*)(Args...), const char* name, bool value, std::vector<InputSpec>& inputs, std::vector<ExpressionInfo>& eInfos, std::vector<StringPair>&, std::vector<StringPair>&)
215+
requires(std::is_lvalue_reference_v<Args> && ...)
219216
{
220-
constexpr auto hash = o2::framework::TypeIdHelpers::uniqueId<R (C::*)(A, Args...)>();
221-
addInputsAndExpressions<std::decay_t<A>, Args...>(hash, name, value, inputs, eInfos);
217+
constexpr auto hash = o2::framework::TypeIdHelpers::uniqueId<R (C::*)(Args...)>();
218+
addInputsAndExpressions<Args...>(hash, name, value, inputs, eInfos);
222219
}
223220

224221
template <soa::TableRef R>

0 commit comments

Comments
 (0)