Skip to content

Commit 506607e

Browse files
committed
fixup! compatibility
1 parent 4285098 commit 506607e

File tree

6 files changed

+63
-50
lines changed

6 files changed

+63
-50
lines changed

Framework/Core/include/Framework/ASoA.h

Lines changed: 43 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -462,23 +462,26 @@ concept has_ng_metadata = not_void<typename aod::MetadataTraitNG<o2::aod::Hash<s
462462
template <typename T>
463463
concept spawnable = std::is_same_v<typename T::spawnable_t, std::true_type>;
464464

465-
template <typename, typename = void>
466-
inline constexpr bool is_soa_extension_table_v = false;
465+
// template <typename, typename = void>
466+
// inline constexpr bool is_soa_extension_table_v = false;
467+
468+
// template <typename T>
469+
// inline constexpr bool is_soa_extension_table_v<T, std::void_t<decltype(sizeof(typename T::expression_pack_t))>> = true;
467470

468471
template <typename T>
469-
inline constexpr bool is_soa_extension_table_v<T, std::void_t<decltype(sizeof(typename T::expression_pack_t))>> = true;
472+
concept extension_table = not_void<typename T::expression_pack_t>;
470473

471-
template <typename T, typename = void>
472-
inline constexpr bool is_index_table_v = false;
474+
// template <typename T, typename = void>
475+
// inline constexpr bool is_index_table_v = false;
473476

474-
template <typename T>
475-
inline constexpr bool is_index_table_v<T, std::void_t<decltype(sizeof(typename T::indexing_t))>> = true;
477+
// template <typename T>
478+
// inline constexpr bool is_index_table_v<T, std::void_t<decltype(sizeof(typename T::indexing_t))>> = true;
476479

477-
template <typename, typename = void>
478-
inline constexpr bool is_with_base_table_v = false;
480+
// template <typename, typename = void>
481+
// inline constexpr bool is_with_base_table_v = false;
479482

480-
template <typename T>
481-
inline constexpr bool is_with_base_table_v<T, std::void_t<decltype(sizeof(typename T::base_table_t))>> = true;
483+
// template <typename T>
484+
// inline constexpr bool is_with_base_table_v<T, std::void_t<decltype(sizeof(typename T::base_table_t))>> = true;
482485

483486
template <typename B, typename E>
484487
struct EquivalentIndex {
@@ -1852,22 +1855,22 @@ using PresliceOptional = PresliceBase<T, true, true>;
18521855

18531856
namespace o2::soa
18541857
{
1855-
template <typename T>
1856-
inline consteval bool is_soa_filtered_iterator_v()
1857-
{
1858-
if constexpr (!soa::ng_iterator<T>) {
1859-
return false;
1860-
} else {
1861-
if constexpr (std::is_same_v<typename T::policy_t, soa::FilteredIndexPolicy>) {
1862-
return true;
1863-
} else {
1864-
return false;
1865-
}
1866-
}
1867-
}
1858+
// template <typename T>
1859+
// inline consteval bool is_soa_filtered_iterator_v()
1860+
// {
1861+
// if constexpr (!soa::ng_iterator<T>) {
1862+
// return false;
1863+
// } else {
1864+
// if constexpr (std::is_same_v<typename T::policy_t, soa::FilteredIndexPolicy>) {
1865+
// return true;
1866+
// } else {
1867+
// return false;
1868+
// }
1869+
// }
1870+
// }
18681871

1869-
template <typename T>
1870-
using is_soa_table_t = typename soa::is_specialization_origin<T, soa::Table>;
1872+
// template <typename T>
1873+
// using is_soa_table_t = typename soa::is_specialization_origin<T, soa::Table>;
18711874

18721875
template <typename T>
18731876
class FilteredBase;
@@ -1879,8 +1882,8 @@ class FilteredBase;
18791882
template <typename T>
18801883
class Filtered;
18811884

1882-
template <typename T>
1883-
inline constexpr bool is_soa_filtered_v = framework::is_base_of_template_v<soa::FilteredBase, T> || framework::is_base_of_template_v<soa::FilteredBase, T>;
1885+
// template <typename T>
1886+
// inline constexpr bool is_soa_filtered_v = framework::is_base_of_template_v<soa::FilteredBase, T> || framework::is_base_of_template_v<soa::FilteredBase, T>;
18841887

18851888
template <typename T>
18861889
concept has_filtered_policy = not_void<typename T::policy_t> && std::same_as<typename T::policy_t, soa::FilteredIndexPolicy>;
@@ -1897,6 +1900,10 @@ concept ng_filtered_iterator = ng_iterator<T> && has_filtered_policy<T>;
18971900
template <typename T>
18981901
concept ng_filtered_table = framework::is_base_of_template_v<soa::FilteredBase, T>;
18991902

1903+
// FIXME: compatbility declaration to be removed
1904+
template <typename T>
1905+
constexpr bool is_soa_filtered_v = ng_filtered_table<T>;
1906+
19001907
// template <typename T>
19011908
// concept soa_filtered = soa_filtered_table<T> || soa_filtered_iterator<T>;
19021909

@@ -1930,7 +1937,7 @@ auto doSliceBy(T const* table, o2::framework::PresliceBase<C, OPT, SORTED> const
19301937
return t;
19311938
} else {
19321939
auto selection = container.getSliceFor(value);
1933-
if constexpr (soa::is_soa_filtered_v<T>) {
1940+
if constexpr (soa::ng_filtered_table<T>) {
19341941
auto t = soa::Filtered<typename T::base_t>({table->asArrowTable()}, selection);
19351942
table->copyIndexBindings(t);
19361943
t.bindInternalIndicesTo(table);
@@ -1956,7 +1963,7 @@ template <typename T>
19561963
auto prepareFilteredSlice(T const* table, std::shared_ptr<arrow::Table> slice, uint64_t offset)
19571964
{
19581965
if (offset >= static_cast<uint64_t>(table->tableSize())) {
1959-
if constexpr (soa::is_soa_filtered_v<T>) {
1966+
if constexpr (soa::ng_filtered_table<T>) {
19601967
Filtered<typename T::base_t> fresult{{{slice}}, SelectionVector{}, 0};
19611968
table->copyIndexBindings(fresult);
19621969
return fresult;
@@ -1976,7 +1983,7 @@ auto prepareFilteredSlice(T const* table, std::shared_ptr<arrow::Table> slice, u
19761983
[&start](int64_t idx) {
19771984
return idx - static_cast<int64_t>(start);
19781985
});
1979-
if constexpr (soa::is_soa_filtered_v<T>) {
1986+
if constexpr (soa::ng_filtered_table<T>) {
19801987
Filtered<typename T::base_t> fresult{{{slice}}, std::move(slicedSelection), start};
19811988
table->copyIndexBindings(fresult);
19821989
return fresult;
@@ -2027,7 +2034,7 @@ template <typename T>
20272034
auto doSliceByCachedUnsorted(T const* table, framework::expressions::BindingNode const& node, int value, o2::framework::SliceCache& cache)
20282035
{
20292036
auto localCache = cache.ptr->getCacheUnsortedFor({o2::soa::getLabelFromTypeForKey<T>(node.name), node.name});
2030-
if constexpr (soa::is_soa_filtered_v<T>) {
2037+
if constexpr (soa::ng_filtered_table<T>) {
20312038
auto t = typename T::self_t({table->asArrowTable()}, localCache.getSliceFor(value));
20322039
t.intersectWithSelection(table->getSelectedRows());
20332040
table->copyIndexBindings(t);
@@ -3392,7 +3399,7 @@ consteval auto getIndexTargets()
33923399
template <typename T> \
33933400
std::vector<typename T::iterator> getFilteredIterators() const \
33943401
{ \
3395-
if constexpr (o2::soa::is_soa_filtered_v<T>) { \
3402+
if constexpr (o2::soa::ng_filtered_table<T>) { \
33963403
auto result = std::vector<typename T::iterator>(); \
33973404
for (auto const& i : *mColumnIterator) { \
33983405
auto pos = mBinding.get<T>()->isInSelectedRows(i); \
@@ -4163,6 +4170,9 @@ constexpr auto join(Ts const&... t)
41634170
return Join<Ts...>(ArrowHelpers::joinTables({t.asArrowTable()...}));
41644171
}
41654172

4173+
template <typename T>
4174+
constexpr bool is_soa_join_v = framework::is_specialization_v<T, JoinFull>;
4175+
41664176
template <typename... Ts>
41674177
struct Concat : TableNG<o2::aod::Hash<"CONC"_h>, o2::aod::Hash<"CONC/0"_h>, o2::aod::Hash<"CONC"_h>, Ts...> {
41684178
using base = TableNG<o2::aod::Hash<"CONC"_h>, o2::aod::Hash<"CONC/0"_h>, o2::aod::Hash<"CONC"_h>, Ts...>;

Framework/Core/include/Framework/ASoAHelpers.h

Lines changed: 5 additions & 5 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::is_soa_filtered_v<T>) {
91+
if constexpr (soa::ng_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::is_soa_filtered_v<T>) {
114+
if constexpr (soa::ng_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::is_soa_filtered_v<T>) {
123+
if constexpr (soa::ng_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::is_soa_filtered_v<T>) {
135+
if constexpr (soa::ng_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::is_soa_filtered_v<T>) {
144+
if constexpr (soa::ng_filtered_table<T>) {
145145
if (ind == selectedRows.size()) {
146146
break;
147147
}

Framework/Core/include/Framework/AnalysisHelpers.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,9 @@ struct TableTransform {
399399
// };
400400

401401
template <typename T>
402+
concept spawnable = soa::ng_table<T> && soa::has_ng_metadata<T>;
403+
404+
template <spawnable T>
402405
struct Spawns : TableTransform<typename aod::MetadataTraitNG<o2::aod::Hash<T::ref.desc_hash>>::metadata, T::ref> {
403406
using metadata = TableTransform<typename aod::MetadataTraitNG<o2::aod::Hash<T::ref.desc_hash>>::metadata, T::ref>::metadata;
404407
using extension_t = typename metadata::extension_table_t;
@@ -650,7 +653,7 @@ struct IndexBuilder {
650653
// }
651654
// };
652655

653-
template <typename T>
656+
template <soa::index_table T>
654657
struct Builds : TableTransform<typename aod::MetadataTraitNG<aod::Hash<T::ref.desc_hash>>::metadata, T::ref> {
655658
using metadata = TableTransform<typename aod::MetadataTraitNG<aod::Hash<T::ref.desc_hash>>::metadata, T::ref>::metadata;
656659
using IP = std::conditional_t<metadata::exclusive, IndexBuilder<Exclusive>, IndexBuilder<Sparse>>;

Framework/Core/include/Framework/AnalysisTask.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ struct AnalysisDataProcessorBuilder {
9696

9797
template <soa::soa_table T>
9898
static inline auto getSources()
99-
requires soa::is_soa_extension_table_v<std::decay_t<T>>
99+
requires soa::extension_table<std::decay_t<T>>
100100
{
101101
return getInputSpecs(typename aod::MetadataTrait<T>::metadata::sources{});
102102
}
@@ -163,7 +163,7 @@ struct AnalysisDataProcessorBuilder {
163163
using metadata = typename aod::MetadataTrait<std::decay_t<O>>::metadata;
164164
std::vector<ConfigParamSpec> inputMetadata;
165165
inputMetadata.emplace_back(ConfigParamSpec{std::string{"control:"} + name, VariantType::Bool, value, {"\"\""}});
166-
if constexpr (soa::is_soa_extension_table_v<std::decay_t<O>>) {
166+
if constexpr (soa::extension_table<std::decay_t<O>>) {
167167
auto inputSources = getInputMetadata<std::decay_t<O>>();
168168
inputMetadata.insert(inputMetadata.end(), inputSources.begin(), inputSources.end());
169169
}
@@ -346,7 +346,7 @@ struct AnalysisDataProcessorBuilder {
346346
template <soa::soa_table T, int AI>
347347
static auto extract(InputRecord& record, std::vector<ExpressionInfo>& infos, size_t phash)
348348
{
349-
if constexpr (soa::is_soa_filtered_v<T>) {
349+
if constexpr (soa::ng_filtered_table<T>) {
350350
return extractFilteredFromRecord<T>(record, *std::find_if(infos.begin(), infos.end(), [&phash](ExpressionInfo const& i) { return (i.processHash == phash && i.argumentIndex == AI); }), soa::make_originals_from_type<T>());
351351
} else {
352352
return extractFromRecord<T>(record, soa::make_originals_from_type<T>());
@@ -356,7 +356,7 @@ struct AnalysisDataProcessorBuilder {
356356
template <soa::ng_table T, int AI>
357357
static auto extract(InputRecord& record, std::vector<ExpressionInfo>& infos, size_t phash)
358358
{
359-
if constexpr (soa::is_soa_filtered_v<T>) {
359+
if constexpr (soa::ng_filtered_table<T>) {
360360
return extractFilteredFromRecord<T>(record, *std::find_if(infos.begin(), infos.end(), [&phash](ExpressionInfo const& i) { return (i.processHash == phash && i.argumentIndex == AI); }));
361361
} else {
362362
return extractFromRecord<T>(record);

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::is_soa_filtered_v<std::decay_t<T>>) {
72+
if constexpr (soa::ng_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::is_soa_filtered_v<std::decay_t<G>>) {
87+
if constexpr (soa::ng_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::is_soa_filtered_v<std::decay_t<G>>) {
162+
if constexpr (soa::ng_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::is_soa_filtered_v<std::decay_t<A1>>) {
176+
if constexpr (soa::ng_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::is_soa_filtered_v<std::decay_t<A1>>) {
203+
if constexpr (soa::ng_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::is_soa_filtered_v<std::decay_t<G>>) {
73+
if constexpr (soa::ng_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::is_soa_filtered_v<std::decay_t<G>>) {
91+
if constexpr (soa::ng_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()});

0 commit comments

Comments
 (0)