7#include <userver/storages/clickhouse/impl/block_wrapper_fwd.hpp>
13template <
typename TypesTuple>
16template <
typename... Ts>
17struct IteratorsTuple<std::tuple<Ts...>> {
18 using type = std::tuple<
typename Ts::iterator...>;
22using IteratorsTupleT =
typename IteratorsTuple<T>::type;
25 typename Seq = std::make_index_sequence<std::tuple_size_v<T>>>
28template <
typename T, size_t... I>
29class IteratorsHelper<T, std::index_sequence<I...>> {
31 static void Init(IteratorsTupleT<T>& begin_iterators,
32 IteratorsTupleT<T>& end_iterators,
33 clickhouse::impl::BlockWrapper& block) {
34 (..., (std::get<I>(begin_iterators) = GetBegin<I>(block)));
35 (..., (std::get<I>(end_iterators) = GetEnd<I>(block)));
38 static void PrefixIncrement(IteratorsTupleT<T>& iterators) {
39 (..., ++std::get<I>(iterators));
42 static IteratorsTupleT<T> PostfixIncrement(IteratorsTupleT<T>& iterators) {
43 return IteratorsTupleT<T>{std::get<I>(iterators)++...};
47 template <size_t Index>
48 static auto GetBegin(clickhouse::impl::BlockWrapper& block) {
49 using ColumnType = std::tuple_element_t<Index, T>;
50 return ColumnType{io::columns::GetWrappedColumn(block, Index)}.begin();
53 template <size_t Index>
54 static auto GetEnd(clickhouse::impl::BlockWrapper& block) {
55 using ColumnType = std::tuple_element_t<Index, T>;
56 return ColumnType{io::columns::GetWrappedColumn(block, Index)}.end();