1 #ifndef cetlib_sqlite_detail_get_result_h 2 #define cetlib_sqlite_detail_get_result_h 12 template <std::
size_t I,
typename Tuple>
13 std::enable_if_t<(I == std::tuple_size_v<Tuple>)>
15 int const ncols [[maybe_unused]],
16 int const currentcol [[maybe_unused]],
19 assert(currentcol == ncols);
22 template <std::
size_t I,
typename Tuple>
23 std::enable_if_t<(I < std::tuple_size_v<Tuple>)>
26 assert(currentcol != ncols);
27 using ET = std::tuple_element_t<I, Tuple>;
28 std::get<I>(
data) = detail::convertTo<ET>(results[currentcol]);
29 fillData<I + 1>(
data, ncols, ++currentcol, results);
32 template <
typename... Args>
34 get_result(
void* data,
int ncols,
char** results,
char** cnames)
38 if (j->columns.empty()) {
39 for (
int i{}; i < ncols; ++i)
40 j->
columns.push_back(cnames[i]);
43 assert(
sizeof...(Args) == ncols);
44 std::tuple<Args...> rowdata;
46 fillData<0u>(rowdata, ncols, currentCol, results);
47 j->data.emplace_back(rowdata);
std::vector< std::string > columns
std::enable_if_t<(I==std::tuple_size_v< Tuple >)> fillData(Tuple &, int const ncols[[maybe_unused]], int const currentcol[[maybe_unused]], char **)
int get_result(void *data, int ncols, char **results, char **cnames)