Skip to content

Commit 3fad0c5

Browse files
committed
rename concepts
1 parent aebfed2 commit 3fad0c5

File tree

10 files changed

+115
-130
lines changed

10 files changed

+115
-130
lines changed

Framework/Core/include/Framework/ASoA.h

Lines changed: 66 additions & 81 deletions
Large diffs are not rendered by default.

Framework/Core/include/Framework/ASoAHelpers.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ std::vector<BinningIndex> groupTable(const T& table, const BP<Cs...>& binningPol
8888
return groupedIndices;
8989
}
9090

91-
if constexpr (soa::ng_filtered_table<T>) {
91+
if constexpr (soa::is_filtered_table<T>) {
9292
selectedRows = table.getSelectedRows(); // vector<int64_t>
9393
}
9494

@@ -111,7 +111,7 @@ std::vector<BinningIndex> groupTable(const T& table, const BP<Cs...>& binningPol
111111
}
112112
});
113113

114-
if constexpr (soa::ng_filtered_table<T>) {
114+
if constexpr (soa::is_filtered_table<T>) {
115115
if (selectedRows[ind] >= selInd + chunkLength) {
116116
selInd += chunkLength;
117117
continue; // Go to the next chunk, no value selected in this chunk
@@ -120,7 +120,7 @@ std::vector<BinningIndex> groupTable(const T& table, const BP<Cs...>& binningPol
120120

121121
uint64_t ai = 0;
122122
while (ai < chunkLength) {
123-
if constexpr (soa::ng_filtered_table<T>) {
123+
if constexpr (soa::is_filtered_table<T>) {
124124
ai += selectedRows[ind] - selInd;
125125
selInd = selectedRows[ind];
126126
}
@@ -132,7 +132,7 @@ std::vector<BinningIndex> groupTable(const T& table, const BP<Cs...>& binningPol
132132
}
133133
ind++;
134134

135-
if constexpr (soa::ng_filtered_table<T>) {
135+
if constexpr (soa::is_filtered_table<T>) {
136136
if (ind >= selectedRows.size()) {
137137
break;
138138
}
@@ -141,7 +141,7 @@ std::vector<BinningIndex> groupTable(const T& table, const BP<Cs...>& binningPol
141141
}
142142
}
143143

144-
if constexpr (soa::ng_filtered_table<T>) {
144+
if constexpr (soa::is_filtered_table<T>) {
145145
if (ind == selectedRows.size()) {
146146
break;
147147
}
@@ -1348,7 +1348,7 @@ auto combinations(const BP& binningPolicy, int categoryNeighbours, const T1& out
13481348
}
13491349
}
13501350

1351-
template <soa::ng_table... T2s>
1351+
template <soa::is_table... T2s>
13521352
auto combinations(const o2::framework::expressions::Filter& filter, const T2s&... tables)
13531353
{
13541354
if constexpr (isSameType<T2s...>()) {
@@ -1366,7 +1366,7 @@ CombinationsGenerator<P2<T2s...>> combinations(const P2<T2s...>& policy)
13661366
return CombinationsGenerator<P2<T2s...>>(policy);
13671367
}
13681368

1369-
template <template <typename...> typename P2, soa::ng_table... T2s>
1369+
template <template <typename...> typename P2, soa::is_table... T2s>
13701370
CombinationsGenerator<P2<Filtered<T2s>...>> combinations(P2<T2s...>&&, const o2::framework::expressions::Filter& filter, const T2s&... tables)
13711371
{
13721372
return CombinationsGenerator<P2<Filtered<T2s>...>>(P2<Filtered<T2s>...>(tables.select(filter)...));

Framework/Core/include/Framework/AnalysisHelpers.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ concept producable = soa::has_metadata<T> || soa::has_metadata<typename T::paren
8989
template <producable T>
9090
struct WritingCursor {
9191
public:
92-
using persistent_table_t = decltype([](){ if constexpr (soa::ng_iterator<T>) { return typename T::parent_t{nullptr}; } else { return T{nullptr}; } }());//std::conditional<soa::ng_iterator<T>, typename T::parent_t, T>;
92+
using persistent_table_t = decltype([](){ if constexpr (soa::is_iterator<T>) { return typename T::parent_t{nullptr}; } else { return T{nullptr}; } }());//std::conditional<soa::is_iterator<T>, typename T::parent_t, T>;
9393
using cursor_t = decltype(std::declval<TableBuilder>().cursor<persistent_table_t>());
9494

9595
template <typename... Ts>
@@ -137,7 +137,7 @@ struct WritingCursor {
137137
template <typename A>
138138
static decltype(auto) extract(A const& arg)
139139
{
140-
if constexpr (soa::ng_iterator<A>) {
140+
if constexpr (soa::is_iterator<A>) {
141141
return arg.globalIndex();
142142
} else {
143143
static_assert(!framework::has_type<A>(typename persistent_table_t::persistent_columns_t{}), "Argument type mismatch");
@@ -189,7 +189,7 @@ struct ProducesGroup {
189189
};
190190

191191
/// Helper template for table transformations
192-
template <o2::aod::ng_metadata M, soa::TableRef Ref>
192+
template <o2::aod::is_metadata M, soa::TableRef Ref>
193193
struct TableTransform {
194194
using metadata = M;
195195
constexpr static auto sources = M::sources;
@@ -226,7 +226,7 @@ struct TableTransform {
226226
/// This helper struct allows you to declare extended tables which should be
227227
/// created by the task (as opposed to those pre-defined by data model)
228228
template <typename T>
229-
concept spawnable = soa::ng_table<T> && soa::has_metadata<T>;
229+
concept spawnable = soa::is_table<T> && soa::has_metadata<T>;
230230

231231
template <spawnable T>
232232
struct Spawns : TableTransform<typename aod::MetadataTrait<o2::aod::Hash<T::ref.desc_hash>>::metadata, T::ref> {
@@ -391,7 +391,7 @@ struct IndexBuilder {
391391
};
392392

393393
/// This helper struct allows you to declare index tables to be created in a task
394-
template <soa::index_table T>
394+
template <soa::is_index_table T>
395395
struct Builds : TableTransform<typename aod::MetadataTrait<aod::Hash<T::ref.desc_hash>>::metadata, T::ref> {
396396
using metadata = TableTransform<typename aod::MetadataTrait<aod::Hash<T::ref.desc_hash>>::metadata, T::ref>::metadata;
397397
using IP = std::conditional_t<metadata::exclusive, IndexBuilder<Exclusive>, IndexBuilder<Sparse>>;
@@ -540,13 +540,13 @@ struct Service {
540540
}
541541
};
542542

543-
auto getTableFromFilter(soa::ng_filtered_table auto const& table, soa::SelectionVector&& selection)
543+
auto getTableFromFilter(soa::is_filtered_table auto const& table, soa::SelectionVector&& selection)
544544
{
545545
return std::make_unique<o2::soa::Filtered<std::decay_t<decltype(table)>>>(std::vector{table}, std::forward<soa::SelectionVector>(selection));
546546
}
547547

548-
template <soa::ng_table T>
549-
requires(!soa::ng_filtered_table<T>)
548+
template <soa::is_table T>
549+
requires(!soa::is_filtered_table<T>)
550550
auto getTableFromFilter(const T& table, soa::SelectionVector&& selection)
551551
{
552552
return std::make_unique<o2::soa::Filtered<T>>(std::vector{table.asArrowTable()}, std::forward<soa::SelectionVector>(selection));
@@ -670,7 +670,7 @@ struct Partition {
670670
namespace o2::soa
671671
{
672672
/// On-the-fly adding of expression columns
673-
template <soa::ng_table T, soa::spawnable... Cs>
673+
template <soa::is_table T, soa::is_spawnable_column... Cs>
674674
auto Extend(T const& table)
675675
{
676676
using output_t = Join<T, soa::Table<o2::aod::Hash<"JOIN"_h>, o2::aod::Hash<"JOIN/0"_h>, o2::aod::Hash<"JOIN"_h>, Cs...>>;
@@ -679,7 +679,7 @@ auto Extend(T const& table)
679679

680680
/// Template function to attach dynamic columns on-the-fly (e.g. inside
681681
/// process() function). Dynamic columns need to be compatible with the table.
682-
template <soa::ng_table T, soa::dynamic... Cs>
682+
template <soa::is_table T, soa::is_dynamic_column... Cs>
683683
auto Attach(T const& table)
684684
{
685685
using output_t = Join<T, o2::soa::Table<o2::aod::Hash<"JOIN"_h>, o2::aod::Hash<"JOIN/0"_h>, o2::aod::Hash<"JOIN"_h>, Cs...>>;

Framework/Core/include/Framework/AnalysisManagers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ struct SpawnManager {
599599
static bool requestInputs(std::vector<InputSpec>&, T const&) { return false; }
600600
};
601601

602-
template <soa::ng_table TABLE>
602+
template <soa::is_table TABLE>
603603
struct SpawnManager<Spawns<TABLE>> {
604604
static bool requestInputs(std::vector<InputSpec>& inputs, Spawns<TABLE>& spawns)
605605
{

Framework/Core/include/Framework/AnalysisTask.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ struct AnalysisDataProcessorBuilder {
109109
{
110110
[&bk, &bku]<typename... As>(framework::pack<As...>) mutable {
111111
std::string key;
112-
if constexpr (soa::ng_iterator<std::decay_t<G>>) {
112+
if constexpr (soa::is_iterator<std::decay_t<G>>) {
113113
key = std::string{"fIndex"} + o2::framework::cutString(soa::getLabelFromType<std::decay_t<G>>());
114114
}
115115
([&bk, &bku, &key]() mutable {
@@ -144,7 +144,7 @@ struct AnalysisDataProcessorBuilder {
144144
{
145145
// update grouping cache
146146
using A0 = std::decay_t<framework::pack_head_t<framework::pack<Args...>>>;
147-
if constexpr (soa::ng_iterator<A0>) {
147+
if constexpr (soa::is_iterator<A0>) {
148148
addGroupingCandidates<Args...>(bk, bku);
149149
}
150150

@@ -160,20 +160,20 @@ struct AnalysisDataProcessorBuilder {
160160
DataSpecUtils::updateInputList(inputs, InputSpec{"enumeration", "DPL", "ENUM", 0, Lifetime::Enumeration, inputMetadata});
161161
} else {
162162
// populate expression infos
163-
if constexpr (soa::ng_filtered_table<T>) {
163+
if constexpr (soa::is_filtered_table<T>) {
164164
auto fields = soa::createFieldsFromColumns(typename T::persistent_columns_t{});
165165
eInfos.emplace_back(ai, hash, T::hashes(), std::make_shared<arrow::Schema>(fields));
166-
} else if constexpr (soa::ng_filtered_iterator<T>) {
166+
} else if constexpr (soa::is_filtered_iterator<T>) {
167167
auto fields = soa::createFieldsFromColumns(typename T::parent_t::persistent_columns_t{});
168168
eInfos.emplace_back(ai, hash, T::parent_t::hashes(), std::make_shared<arrow::Schema>(fields));
169169
}
170170
// add inputs from the originals
171171
auto adder = [&name, &value, &inputs]<size_t N, std::array<soa::TableRef, N> refs, size_t... Is>(std::index_sequence<Is...>) mutable {
172172
(addOriginalRef<refs[Is]>(name, value, inputs), ...);
173173
};
174-
if constexpr (soa::ng_table<T> || soa::ng_filtered_table<T>) {
174+
if constexpr (soa::is_table<T> || soa::is_filtered_table<T>) {
175175
adder.template operator()<T::originals.size(), T::originals>(std::make_index_sequence<T::originals.size()>());
176-
} else if constexpr (soa::ng_iterator<T> || soa::ng_filtered_iterator<T>) {
176+
} else if constexpr (soa::is_iterator<T> || soa::is_filtered_iterator<T>) {
177177
adder.template operator()<T::parent_t::originals.size(), T::parent_t::originals>(std::make_index_sequence<T::parent_t::originals.size()>());
178178
}
179179
}
@@ -192,24 +192,24 @@ struct AnalysisDataProcessorBuilder {
192192
return table;
193193
}
194194

195-
template <soa::ng_table T>
195+
template <soa::is_table T>
196196
static auto extractFromRecord(InputRecord& record)
197197
{
198198
return T{[&record]<size_t N, std::array<soa::TableRef, N> refs, size_t... Is>(std::index_sequence<Is...>){ return std::vector{extractTableFromRecord<refs[Is]>(record)...}; }.template operator()<T::originals.size(), T::originals>(std::make_index_sequence<T::originals.size()>())};
199199
}
200200

201-
template <soa::ng_iterator T>
201+
template <soa::is_iterator T>
202202
static auto extractFromRecord(InputRecord& record)
203203
{
204204
return typename T::parent_t{[&record]<size_t N, std::array<soa::TableRef, N> refs, size_t... Is>(std::index_sequence<Is...>){ return std::vector{extractTableFromRecord<refs[Is]>(record)...}; }.template operator()<T::parent_t::originals.size(), T::parent_t::originals>(std::make_index_sequence<T::parent_t::originals.size()>())};
205205
}
206206

207-
template <soa::ng_filtered T>
207+
template <soa::is_filtered T>
208208
static auto extractFilteredFromRecord(InputRecord& record, ExpressionInfo& info)
209209
{
210210
std::shared_ptr<arrow::Table> table = nullptr;
211211
auto joiner = [&record]<size_t N, std::array<soa::TableRef, N> refs, size_t... Is>(std::index_sequence<Is...>){ return std::vector{extractTableFromRecord<refs[Is]>(record)...}; };
212-
if constexpr (soa::ng_iterator<T>) {
212+
if constexpr (soa::is_iterator<T>) {
213213
table = o2::soa::ArrowHelpers::joinTables(joiner.template operator()<T::parent_t::originals.size(), T::parent_t::originals>(std::make_index_sequence<T::parent_t::originals.size()>()));
214214
} else {
215215
table = o2::soa::ArrowHelpers::joinTables(joiner.template operator()<T::originals.size(), T::originals>(std::make_index_sequence<T::originals.size()>()));
@@ -220,7 +220,7 @@ struct AnalysisDataProcessorBuilder {
220220
soa::missingFilterDeclaration(info.processHash, info.argumentIndex);
221221
}
222222
}
223-
if constexpr (soa::ng_iterator<T>) {
223+
if constexpr (soa::is_iterator<T>) {
224224
return typename T::parent_t({table}, info.selection);
225225
} else {
226226
return T({table}, info.selection);
@@ -233,7 +233,7 @@ struct AnalysisDataProcessorBuilder {
233233
return T{};
234234
}
235235

236-
template <soa::ng_iterator T, int AI>
236+
template <soa::is_iterator T, int AI>
237237
static auto extract(InputRecord& record, std::vector<ExpressionInfo>& infos, size_t phash)
238238
{
239239
if constexpr (std::is_same_v<typename T::policy_t, soa::FilteredIndexPolicy>) {
@@ -243,10 +243,10 @@ struct AnalysisDataProcessorBuilder {
243243
}
244244
}
245245

246-
template <soa::ng_table T, int AI>
246+
template <soa::is_table T, int AI>
247247
static auto extract(InputRecord& record, std::vector<ExpressionInfo>& infos, size_t phash)
248248
{
249-
if constexpr (soa::ng_filtered_table<T>) {
249+
if constexpr (soa::is_filtered_table<T>) {
250250
return extractFilteredFromRecord<T>(record, *std::find_if(infos.begin(), infos.end(), [&phash](ExpressionInfo const& i) { return (i.processHash == phash && i.argumentIndex == AI); }));
251251
} else {
252252
return extractFromRecord<T>(record);
@@ -298,18 +298,18 @@ struct AnalysisDataProcessorBuilder {
298298
return true;
299299
},
300300
task);
301-
if constexpr (soa::ng_iterator<G>) {
301+
if constexpr (soa::is_iterator<G>) {
302302
for (auto& element : groupingTable) {
303303
std::invoke(processingFunction, task, *element);
304304
}
305305
} else {
306-
static_assert(soa::ng_table<G> || is_enumeration_v<G>,
306+
static_assert(soa::is_table<G> || is_enumeration_v<G>,
307307
"Single argument of process() should be a table-like or an iterator");
308308
std::invoke(processingFunction, task, groupingTable);
309309
}
310310
} else {
311311
// multiple arguments to process
312-
static_assert(((soa::ng_iterator<std::decay_t<Associated>> == false) && ...),
312+
static_assert(((soa::is_iterator<std::decay_t<Associated>> == false) && ...),
313313
"Associated arguments of process() should not be iterators");
314314
auto associatedTables = AnalysisDataProcessorBuilder::bindAssociatedTables(inputs, processingFunction, infos);
315315
// pre-bind self indices
@@ -350,7 +350,7 @@ struct AnalysisDataProcessorBuilder {
350350
},
351351
task);
352352
overwriteInternalIndices(associatedTables, associatedTables);
353-
if constexpr (soa::ng_iterator<std::decay_t<G>>) {
353+
if constexpr (soa::is_iterator<std::decay_t<G>>) {
354354
auto slicer = GroupSlicer(groupingTable, associatedTables, slices);
355355
for (auto& slice : slicer) {
356356
auto associatedSlices = slice.associatedTables();

Framework/Core/include/Framework/BinningPolicy.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ struct FlexibleBinningPolicy<std::tuple<Ls...>, Ts...> : BinningPolicyBase<sizeo
267267
return BinningPolicyBase<sizeof...(Ts)>::template getBin<T2s...>(data);
268268
}
269269

270-
using persistent_columns_t = framework::selected_pack<o2::soa::is_persistent_t, Ts...>;
270+
using persistent_columns_t = framework::selected_pack<o2::soa::is_persistent_column_t, Ts...>;
271271

272272
private:
273273
std::tuple<Ls...> mBinningFunctions;
@@ -296,7 +296,7 @@ struct ColumnBinningPolicy : BinningPolicyBase<sizeof...(Ts)> {
296296
return BinningPolicyBase<sizeof...(Ts)>::template getBin<typename Ts::type...>(data);
297297
}
298298

299-
using persistent_columns_t = framework::selected_pack<o2::soa::is_persistent_t, Ts...>;
299+
using persistent_columns_t = framework::selected_pack<o2::soa::is_persistent_column_t, Ts...>;
300300
};
301301

302302
template <typename C>
@@ -321,7 +321,7 @@ struct NoBinningPolicy {
321321
return std::get<0>(data);
322322
}
323323

324-
using persistent_columns_t = framework::selected_pack<o2::soa::is_persistent_t, C>;
324+
using persistent_columns_t = framework::selected_pack<o2::soa::is_persistent_column_t, C>;
325325
};
326326

327327
} // namespace o2::framework

Framework/Core/include/Framework/GroupSlicer.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ struct GroupSlicer {
6969
template <typename T>
7070
auto extractingFunction(T&& table)
7171
{
72-
if constexpr (soa::ng_filtered_table<std::decay_t<T>>) {
72+
if constexpr (soa::is_filtered_table<std::decay_t<T>>) {
7373
constexpr auto index = framework::has_type_at_v<std::decay_t<T>>(associated_pack_t{});
7474
selections[index] = &table.getSelectedRows();
7575
starts[index] = selections[index]->begin();
@@ -84,7 +84,7 @@ struct GroupSlicer {
8484
position{0},
8585
mSlices{&slices}
8686
{
87-
if constexpr (soa::ng_filtered_table<std::decay_t<G>>) {
87+
if constexpr (soa::is_filtered_table<std::decay_t<G>>) {
8888
groupSelection = mGt->getSelectedRows();
8989
}
9090

@@ -159,7 +159,7 @@ struct GroupSlicer {
159159

160160
if constexpr (o2::soa::relatedByIndex<std::decay_t<G>, std::decay_t<A1>>()) {
161161
uint64_t pos;
162-
if constexpr (soa::ng_filtered_table<std::decay_t<G>>) {
162+
if constexpr (soa::is_filtered_table<std::decay_t<G>>) {
163163
pos = groupSelection[position];
164164
} else {
165165
pos = position;
@@ -173,7 +173,7 @@ struct GroupSlicer {
173173
auto oc = sliceInfos[index].getSliceFor(pos);
174174
uint64_t offset = oc.first;
175175
auto count = oc.second;
176-
if constexpr (soa::ng_filtered_table<std::decay_t<A1>>) {
176+
if constexpr (soa::is_filtered_table<std::decay_t<A1>>) {
177177
auto groupedElementsTable = originalTable.asArrowTable()->Slice(offset, count);
178178
if (count == 0) {
179179
return std::decay_t<A1>{{groupedElementsTable}, soa::SelectionVector{}};
@@ -200,7 +200,7 @@ struct GroupSlicer {
200200
}
201201
} else {
202202
// generic split
203-
if constexpr (soa::ng_filtered_table<std::decay_t<A1>>) {
203+
if constexpr (soa::is_filtered_table<std::decay_t<A1>>) {
204204
auto selection = sliceInfosUnsorted[index].getSliceFor(pos);
205205
// intersect selections
206206
o2::soa::SelectionVector s;

Framework/Core/include/Framework/GroupedCombinations.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ struct GroupedCombinationsGenerator {
7070
mIndexColumns{getMatchingIndexNode<G, As>()...},
7171
cache{cache_}
7272
{
73-
if constexpr (soa::ng_filtered_table<std::decay_t<G>>) {
73+
if constexpr (soa::is_filtered_table<std::decay_t<G>>) {
7474
mGrouping = std::make_shared<G>(std::vector{grouping.asArrowTable()}, grouping.getSelectedRows());
7575
} else {
7676
mGrouping = std::make_shared<G>(std::vector{grouping.asArrowTable()});
@@ -88,7 +88,7 @@ struct GroupedCombinationsGenerator {
8888
template <typename... T2s>
8989
void setTables(const G& grouping, const std::tuple<T2s...>& associated)
9090
{
91-
if constexpr (soa::ng_filtered_table<std::decay_t<G>>) {
91+
if constexpr (soa::is_filtered_table<std::decay_t<G>>) {
9292
mGrouping = std::make_shared<G>(std::vector{grouping.asArrowTable()}, grouping.getSelectedRows());
9393
} else {
9494
mGrouping = std::make_shared<G>(std::vector{grouping.asArrowTable()});

Framework/Core/include/Framework/TableBuilder.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,7 @@ std::shared_ptr<arrow::Table> spawnerHelper(std::shared_ptr<arrow::Table> const&
888888
expressions::Projector* projectors, std::vector<std::shared_ptr<arrow::Field>> const& fields, const char* name);
889889

890890
/// Expression-based column generator to materialize columns
891-
template <aod::aod_hash D>
891+
template <aod::is_aod_hash D>
892892
auto spawner(std::vector<std::shared_ptr<arrow::Table>>&& tables, const char* name)
893893
{
894894
using expression_pack_t = typename o2::aod::MetadataTrait<D>::metadata::expression_pack_t;
@@ -906,7 +906,7 @@ auto spawner(std::vector<std::shared_ptr<arrow::Table>>&& tables, const char* na
906906
return spawnerHelper(fullTable, new_schema, framework::pack_size(expression_pack_t{}), projectors.data(), fields, name);
907907
}
908908

909-
template <aod::aod_hash D>
909+
template <aod::is_aod_hash D>
910910
auto spawner(std::shared_ptr<arrow::Table> const& fullTable, const char* name)
911911
{
912912
using expression_pack_t = typename o2::aod::MetadataTrait<D>::metadata::expression_pack_t;

0 commit comments

Comments
 (0)