algo_params.hpp 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. //
  2. // Copyright (c) 2019-2025 Ruben Perez Hidalgo (rubenperez038 at gmail dot com)
  3. //
  4. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. #ifndef BOOST_MYSQL_DETAIL_ALGO_PARAMS_HPP
  8. #define BOOST_MYSQL_DETAIL_ALGO_PARAMS_HPP
  9. #include <boost/mysql/character_set.hpp>
  10. #include <boost/mysql/handshake_params.hpp>
  11. #include <boost/mysql/string_view.hpp>
  12. #include <boost/mysql/detail/any_execution_request.hpp>
  13. #include <boost/mysql/detail/execution_processor/execution_processor.hpp>
  14. #include <boost/core/span.hpp>
  15. #include <cstddef>
  16. #include <cstdint>
  17. #include <vector>
  18. namespace boost {
  19. namespace mysql {
  20. class rows_view;
  21. class statement;
  22. class stage_response;
  23. namespace detail {
  24. class execution_processor;
  25. class execution_state_impl;
  26. struct pipeline_request_stage;
  27. struct connect_algo_params
  28. {
  29. const void* server_address; // Points to an any_address or an endpoint for the corresponding stream. For
  30. // the templated connection, only valid until the first yield!
  31. handshake_params hparams;
  32. bool secure_channel; // Are we using UNIX sockets or any other secure channel?
  33. using result_type = void;
  34. };
  35. struct handshake_algo_params
  36. {
  37. handshake_params hparams;
  38. bool secure_channel; // Are we using UNIX sockets or any other secure channel?
  39. using result_type = void;
  40. };
  41. struct execute_algo_params
  42. {
  43. any_execution_request req;
  44. execution_processor* proc;
  45. using result_type = void;
  46. };
  47. struct start_execution_algo_params
  48. {
  49. any_execution_request req;
  50. execution_processor* proc;
  51. using result_type = void;
  52. };
  53. struct read_resultset_head_algo_params
  54. {
  55. execution_processor* proc;
  56. using result_type = void;
  57. };
  58. struct read_some_rows_algo_params
  59. {
  60. execution_processor* proc;
  61. output_ref output;
  62. using result_type = std::size_t;
  63. };
  64. struct read_some_rows_dynamic_algo_params
  65. {
  66. execution_state_impl* exec_st;
  67. using result_type = rows_view;
  68. };
  69. struct prepare_statement_algo_params
  70. {
  71. string_view stmt_sql;
  72. using result_type = statement;
  73. };
  74. struct close_statement_algo_params
  75. {
  76. std::uint32_t stmt_id;
  77. using result_type = void;
  78. };
  79. struct ping_algo_params
  80. {
  81. using result_type = void;
  82. };
  83. struct reset_connection_algo_params
  84. {
  85. using result_type = void;
  86. };
  87. struct set_character_set_algo_params
  88. {
  89. character_set charset;
  90. using result_type = void;
  91. };
  92. struct quit_connection_algo_params
  93. {
  94. using result_type = void;
  95. };
  96. struct close_connection_algo_params
  97. {
  98. using result_type = void;
  99. };
  100. struct run_pipeline_algo_params
  101. {
  102. span<const std::uint8_t> request_buffer;
  103. span<const pipeline_request_stage> request_stages;
  104. std::vector<stage_response>* response;
  105. using result_type = void;
  106. };
  107. } // namespace detail
  108. } // namespace mysql
  109. } // namespace boost
  110. #endif