Skip to content

Commit

Permalink
fixup! DPL Analysis: remove unnecessary instances of selected_pack
Browse files Browse the repository at this point in the history
  • Loading branch information
aalkin committed Jan 23, 2025
1 parent 7218b61 commit d2aceb2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
27 changes: 16 additions & 11 deletions Framework/Core/include/Framework/ASoA.h
Original file line number Diff line number Diff line change
Expand Up @@ -1027,11 +1027,15 @@ template <typename... C>
concept has_index = (is_indexing_column<C> || ...);

template <is_index_column C>
requires (!is_self_index_column<C>)
auto getBinding() -> typename C::binding_t {}
requires(!is_self_index_column<C>)
auto getBinding() -> typename C::binding_t
{
}

template <typename C>
auto getBinding() -> void {}
auto getBinding() -> void
{
}

template <typename D, typename O, typename IP, typename... C>
struct TableIterator : IP, C... {
Expand Down Expand Up @@ -1135,7 +1139,7 @@ struct TableIterator : IP, C... {
template <typename... CL, typename TA>
void doSetCurrentIndex(framework::pack<CL...>, TA* current)
{
([&current, this](){ if constexpr (is_index_column<CL> && !is_self_index_column<CL>) {CL::setCurrent(current);} }(), ...);
([&current, this]() { if constexpr (is_index_column<CL> && !is_self_index_column<CL>) {CL::setCurrent(current);} }(), ...);
}

template <typename CL>
Expand All @@ -1148,11 +1152,12 @@ struct TableIterator : IP, C... {
auto getIndexBindingsImpl(framework::pack<Cs...>) const
{
std::vector<o2::soa::Binding> result;
([this, &result](){
([this, &result]() {
if constexpr (is_index_column<Cs> && !is_self_index_column<Cs>) {
result.emplace_back(static_cast<Cs const&>(*this).getCurrentRaw());
}
}(), ...);
}(),
...);
return result;
}

Expand All @@ -1170,15 +1175,15 @@ struct TableIterator : IP, C... {
template <typename... Cs>
void doSetCurrentIndexRaw(framework::pack<Cs...> p, std::vector<o2::soa::Binding>&& ptrs)
{
([&ptrs, p, this](){ if constexpr (is_index_column<Cs> && !is_self_index_column<Cs>) { Cs::setCurrentRaw(ptrs[framework::has_type_at_v<Cs>(p)]); } }(), ...);
([&ptrs, p, this]() { if constexpr (is_index_column<Cs> && !is_self_index_column<Cs>) { Cs::setCurrentRaw(ptrs[framework::has_type_at_v<Cs>(p)]); } }(), ...);
}

template <typename... Cs, typename I>
void doSetCurrentInternal(framework::pack<Cs...>, I const* ptr)
{
o2::soa::Binding b;
b.bind(ptr);
([&ptr, &b, this](){ if constexpr (is_self_index_column<Cs>) { Cs::setCurrentRaw(b); } }(), ...);
([&ptr, &b, this]() { if constexpr (is_self_index_column<Cs>) { Cs::setCurrentRaw(b); } }(), ...);
}

void bindExternalIndicesRaw(std::vector<o2::soa::Binding>&& ptrs)
Expand Down Expand Up @@ -1373,13 +1378,13 @@ static constexpr std::string getLabelFromTypeForKey(std::string const& key)
template <typename B, typename... C>
consteval static bool hasIndexTo(framework::pack<C...>&&)
{
return ([](){ if constexpr (is_index_column<C> && !is_self_index_column<C>) { return o2::soa::is_binding_compatible_v<B, typename C::binding_t>(); } else { return false; } }() || ...);
return ([]() { if constexpr (is_index_column<C> && !is_self_index_column<C>) { return o2::soa::is_binding_compatible_v<B, typename C::binding_t>(); } else { return false; } }() || ...);
}

template <typename B, typename... C>
consteval static bool hasSortedIndexTo(framework::pack<C...>&&)
{
return ([](){if constexpr (is_index_column<C> && !is_self_index_column<C>) { return (C::sorted && o2::soa::is_binding_compatible_v<B, typename C::binding_t>()); } else { return false; }}() || ...);
return ([]() {if constexpr (is_index_column<C> && !is_self_index_column<C>) { return (C::sorted && o2::soa::is_binding_compatible_v<B, typename C::binding_t>()); } else { return false; } }() || ...);
}

template <typename B, typename Z>
Expand Down Expand Up @@ -2064,7 +2069,7 @@ class Table
template <typename... Cs>
void doBindInternalIndicesExplicit(framework::pack<Cs...>, o2::soa::Binding binding)
{
([this, &binding](){ if constexpr (is_self_index_column<Cs>) { static_cast<Cs>(mBegin).setCurrentRaw(binding); } }(), ...);
([this, &binding]() { if constexpr (is_self_index_column<Cs>) { static_cast<Cs>(mBegin).setCurrentRaw(binding); } }(), ...);
}

void bindExternalIndicesRaw(std::vector<o2::soa::Binding>&& ptrs)
Expand Down
4 changes: 3 additions & 1 deletion Framework/Core/include/Framework/GroupedCombinations.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ auto isIndexTo()
}

template <typename T, typename G>
auto isIndexTo() ->std::false_type {}
auto isIndexTo() -> std::false_type
{
}

template <typename T, typename G>
using is_index_to_g_t = decltype(isIndexTo<T, G>());
Expand Down

0 comments on commit d2aceb2

Please sign in to comment.