Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-19 08:33:52

0001 //
0002 // Copyright (c) 2019-2024 Ruben Perez Hidalgo (rubenperez038 at gmail dot com)
0003 //
0004 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0005 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 //
0007 
0008 #ifndef BOOST_MYSQL_IMPL_INTERNAL_SANSIO_READ_SOME_ROWS_DYNAMIC_HPP
0009 #define BOOST_MYSQL_IMPL_INTERNAL_SANSIO_READ_SOME_ROWS_DYNAMIC_HPP
0010 
0011 #include <boost/mysql/diagnostics.hpp>
0012 #include <boost/mysql/error_code.hpp>
0013 #include <boost/mysql/rows_view.hpp>
0014 
0015 #include <boost/mysql/detail/access.hpp>
0016 #include <boost/mysql/detail/algo_params.hpp>
0017 #include <boost/mysql/detail/execution_processor/execution_processor.hpp>
0018 #include <boost/mysql/detail/execution_processor/execution_state_impl.hpp>
0019 
0020 #include <boost/mysql/impl/internal/sansio/connection_state_data.hpp>
0021 #include <boost/mysql/impl/internal/sansio/read_some_rows.hpp>
0022 
0023 #include <cstddef>
0024 
0025 namespace boost {
0026 namespace mysql {
0027 namespace detail {
0028 
0029 class read_some_rows_dynamic_algo : public read_some_rows_algo
0030 {
0031 public:
0032     read_some_rows_dynamic_algo(read_some_rows_dynamic_algo_params params) noexcept
0033         : read_some_rows_algo(read_some_rows_algo_params{params.diag, params.exec_st, output_ref()})
0034     {
0035     }
0036 
0037     rows_view result(const connection_state_data& st) const
0038     {
0039         std::size_t num_rows = read_some_rows_algo::result(st);
0040         std::size_t num_cols = static_cast<const execution_state_impl&>(processor()).meta().size();
0041         return access::construct<rows_view>(st.shared_fields.data(), num_rows * num_cols, num_cols);
0042     }
0043 };
0044 
0045 }  // namespace detail
0046 }  // namespace mysql
0047 }  // namespace boost
0048 
0049 #endif