diff --git a/Framework/Core/include/Framework/ASoA.h b/Framework/Core/include/Framework/ASoA.h index ccf2cab5e6807..c20e6b9e7f5ff 100644 --- a/Framework/Core/include/Framework/ASoA.h +++ b/Framework/Core/include/Framework/ASoA.h @@ -2157,61 +2157,14 @@ void emptyColumnLabel(); namespace row_helpers { -template -std::array getArrowColumns(arrow::Table* table, framework::pack) -{ - return std::array{o2::soa::getIndexFromLabel(table, Cs::columnLabel())...}; -} - -template -std::array, sizeof...(Cs)> getChunks(arrow::Table* table, framework::pack, uint64_t ci) -{ - return std::array, sizeof...(Cs)>{o2::soa::getIndexFromLabel(table, Cs::columnLabel())->chunk(ci)...}; -} - -template -typename C::type getSingleRowData(arrow::Table* table, T& rowIterator, uint64_t ci = std::numeric_limits::max(), uint64_t ai = std::numeric_limits::max(), uint64_t globalIndex = std::numeric_limits::max()) -{ - if (ci == std::numeric_limits::max() || ai == std::numeric_limits::max()) { - auto colIterator = static_cast(rowIterator).getIterator(); - ci = colIterator.mCurrentChunk; - ai = *(colIterator.mCurrentPos) - colIterator.mFirstIndex; - } - return std::static_pointer_cast>(o2::soa::getIndexFromLabel(table, C::columnLabel())->chunk(ci))->raw_values()[ai]; -} - -template -typename C::type getSingleRowData(arrow::Table*, T& rowIterator, uint64_t ci = std::numeric_limits::max(), uint64_t ai = std::numeric_limits::max(), uint64_t globalIndex = std::numeric_limits::max()) -{ - if (globalIndex != std::numeric_limits::max() && globalIndex != *std::get<0>(rowIterator.getIndices())) { - rowIterator.setCursor(globalIndex); - } - return rowIterator.template getDynamicColumn(); -} - -template -typename C::type getSingleRowData(arrow::Table*, T& rowIterator, uint64_t ci = std::numeric_limits::max(), uint64_t ai = std::numeric_limits::max(), uint64_t globalIndex = std::numeric_limits::max()) -{ - if (globalIndex != std::numeric_limits::max() && globalIndex != *std::get<0>(rowIterator.getIndices())) { - rowIterator.setCursor(globalIndex); - } - return rowIterator.template getId(); -} - -template -std::tuple getRowData(arrow::Table* table, T rowIterator, uint64_t ci = std::numeric_limits::max(), uint64_t ai = std::numeric_limits::max(), uint64_t globalIndex = std::numeric_limits::max()) -{ - return std::make_tuple(getSingleRowData(table, rowIterator, ci, ai, globalIndex)...); -} - -namespace -{ template R getColumnValue(const T& rowIterator) { return static_cast(static_cast(rowIterator).get()); } +namespace +{ template using ColumnGetterFunction = R (*)(const T&); diff --git a/Framework/Core/include/Framework/ASoAHelpers.h b/Framework/Core/include/Framework/ASoAHelpers.h index 5bf474e61f935..0449bdfdc2a0c 100644 --- a/Framework/Core/include/Framework/ASoAHelpers.h +++ b/Framework/Core/include/Framework/ASoAHelpers.h @@ -76,76 +76,13 @@ void dataSizeVariesBetweenColumns(); template