network_algorithms.ipp 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. //
  2. // Copyright (c) 2019-2023 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 BHO_MYSQL_IMPL_NETWORK_ALGORITHMS_IPP
  8. #define BHO_MYSQL_IMPL_NETWORK_ALGORITHMS_IPP
  9. #pragma once
  10. #include <asio2/bho/mysql/detail/network_algorithms.hpp>
  11. #include <asio2/bho/mysql/impl/internal/network_algorithms/close_connection.hpp>
  12. #include <asio2/bho/mysql/impl/internal/network_algorithms/close_statement.hpp>
  13. #include <asio2/bho/mysql/impl/internal/network_algorithms/connect.hpp>
  14. #include <asio2/bho/mysql/impl/internal/network_algorithms/execute.hpp>
  15. #include <asio2/bho/mysql/impl/internal/network_algorithms/handshake.hpp>
  16. #include <asio2/bho/mysql/impl/internal/network_algorithms/ping.hpp>
  17. #include <asio2/bho/mysql/impl/internal/network_algorithms/prepare_statement.hpp>
  18. #include <asio2/bho/mysql/impl/internal/network_algorithms/quit_connection.hpp>
  19. #include <asio2/bho/mysql/impl/internal/network_algorithms/read_resultset_head.hpp>
  20. #include <asio2/bho/mysql/impl/internal/network_algorithms/read_some_rows.hpp>
  21. #include <asio2/bho/mysql/impl/internal/network_algorithms/read_some_rows_dynamic.hpp>
  22. #include <asio2/bho/mysql/impl/internal/network_algorithms/reset_connection.hpp>
  23. #include <asio2/bho/mysql/impl/internal/network_algorithms/start_execution.hpp>
  24. void bho::mysql::detail::connect_erased(
  25. channel& chan,
  26. const void* endpoint,
  27. const handshake_params& params,
  28. error_code& err,
  29. diagnostics& diag
  30. )
  31. {
  32. connect_impl(chan, endpoint, params, err, diag);
  33. }
  34. void bho::mysql::detail::async_connect_erased(
  35. channel& chan,
  36. const void* endpoint,
  37. const handshake_params& params,
  38. diagnostics& diag,
  39. any_void_handler handler
  40. )
  41. {
  42. async_connect_impl(chan, endpoint, params, diag, std::move(handler));
  43. }
  44. void bho::mysql::detail::handshake_erased(
  45. channel& channel,
  46. const handshake_params& params,
  47. error_code& err,
  48. diagnostics& diag
  49. )
  50. {
  51. handshake_impl(channel, params, err, diag);
  52. }
  53. void bho::mysql::detail::async_handshake_erased(
  54. channel& chan,
  55. const handshake_params& params,
  56. diagnostics& diag,
  57. any_void_handler handler
  58. )
  59. {
  60. async_handshake_impl(chan, params, diag, std::move(handler));
  61. }
  62. void bho::mysql::detail::execute_erased(
  63. channel& channel,
  64. const any_execution_request& req,
  65. execution_processor& output,
  66. error_code& err,
  67. diagnostics& diag
  68. )
  69. {
  70. execute_impl(channel, req, output, err, diag);
  71. }
  72. void bho::mysql::detail::async_execute_erased(
  73. channel& chan,
  74. const any_execution_request& req,
  75. execution_processor& output,
  76. diagnostics& diag,
  77. any_void_handler handler
  78. )
  79. {
  80. async_execute_impl(chan, req, output, diag, std::move(handler));
  81. }
  82. void bho::mysql::detail::start_execution_erased(
  83. channel& channel,
  84. const any_execution_request& req,
  85. execution_processor& proc,
  86. error_code& err,
  87. diagnostics& diag
  88. )
  89. {
  90. start_execution_impl(channel, req, proc, err, diag);
  91. }
  92. void bho::mysql::detail::async_start_execution_erased(
  93. channel& channel,
  94. const any_execution_request& req,
  95. execution_processor& proc,
  96. diagnostics& diag,
  97. any_void_handler handler
  98. )
  99. {
  100. async_start_execution_impl(channel, req, proc, diag, std::move(handler));
  101. }
  102. bho::mysql::statement bho::mysql::detail::prepare_statement_erased(
  103. channel& chan,
  104. string_view stmt,
  105. error_code& err,
  106. diagnostics& diag
  107. )
  108. {
  109. return prepare_statement_impl(chan, stmt, err, diag);
  110. }
  111. void bho::mysql::detail::async_prepare_statement_erased(
  112. channel& chan,
  113. string_view stmt,
  114. diagnostics& diag,
  115. any_handler<statement> handler
  116. )
  117. {
  118. async_prepare_statement_impl(chan, stmt, diag, std::move(handler));
  119. }
  120. void bho::mysql::detail::close_statement_erased(
  121. channel& chan,
  122. const statement& stmt,
  123. error_code& err,
  124. diagnostics& diag
  125. )
  126. {
  127. close_statement_impl(chan, stmt, err, diag);
  128. }
  129. void bho::mysql::detail::async_close_statement_erased(
  130. channel& chan,
  131. const statement& stmt,
  132. diagnostics& diag,
  133. any_void_handler handler
  134. )
  135. {
  136. async_close_statement_impl(chan, stmt, diag, std::move(handler));
  137. }
  138. bho::mysql::rows_view bho::mysql::detail::read_some_rows_dynamic_erased(
  139. channel& chan,
  140. execution_state_impl& st,
  141. error_code& err,
  142. diagnostics& diag
  143. )
  144. {
  145. return read_some_rows_dynamic_impl(chan, st, err, diag);
  146. }
  147. void bho::mysql::detail::async_read_some_rows_dynamic_erased(
  148. channel& chan,
  149. execution_state_impl& st,
  150. diagnostics& diag,
  151. any_handler<rows_view> handler
  152. )
  153. {
  154. async_read_some_rows_dynamic_impl(chan, st, diag, std::move(handler));
  155. }
  156. std::size_t bho::mysql::detail::read_some_rows_static_erased(
  157. channel& chan,
  158. execution_processor& proc,
  159. const output_ref& output,
  160. error_code& err,
  161. diagnostics& diag
  162. )
  163. {
  164. return read_some_rows_impl(chan, proc, output, err, diag);
  165. }
  166. void bho::mysql::detail::async_read_some_rows_erased(
  167. channel& chan,
  168. execution_processor& proc,
  169. const output_ref& output,
  170. diagnostics& diag,
  171. any_handler<std::size_t> handler
  172. )
  173. {
  174. async_read_some_rows_impl(chan, proc, output, diag, std::move(handler));
  175. }
  176. void bho::mysql::detail::read_resultset_head_erased(
  177. channel& channel,
  178. execution_processor& proc,
  179. error_code& err,
  180. diagnostics& diag
  181. )
  182. {
  183. read_resultset_head_impl(channel, proc, err, diag);
  184. }
  185. void bho::mysql::detail::async_read_resultset_head_erased(
  186. channel& chan,
  187. execution_processor& proc,
  188. diagnostics& diag,
  189. any_void_handler handler
  190. )
  191. {
  192. async_read_resultset_head_impl(chan, proc, diag, std::move(handler));
  193. }
  194. void bho::mysql::detail::ping_erased(channel& chan, error_code& code, diagnostics& diag)
  195. {
  196. ping_impl(chan, code, diag);
  197. }
  198. void bho::mysql::detail::async_ping_erased(channel& chan, diagnostics& diag, any_void_handler handler)
  199. {
  200. async_ping_impl(chan, diag, std::move(handler));
  201. }
  202. void bho::mysql::detail::reset_connection_erased(channel& chan, error_code& code, diagnostics& diag)
  203. {
  204. reset_connection_impl(chan, code, diag);
  205. }
  206. void bho::mysql::detail::async_reset_connection_erased(
  207. channel& chan,
  208. diagnostics& diag,
  209. any_void_handler handler
  210. )
  211. {
  212. async_reset_connection_impl(chan, diag, std::move(handler));
  213. }
  214. void bho::mysql::detail::close_connection_erased(channel& chan, error_code& code, diagnostics& diag)
  215. {
  216. close_connection_impl(chan, code, diag);
  217. }
  218. void bho::mysql::detail::async_close_connection_erased(
  219. channel& chan,
  220. diagnostics& diag,
  221. any_void_handler handler
  222. )
  223. {
  224. async_close_connection_impl(chan, diag, std::move(handler));
  225. }
  226. void bho::mysql::detail::quit_connection_erased(channel& chan, error_code& err, diagnostics& diag)
  227. {
  228. quit_connection_impl(chan, err, diag);
  229. }
  230. void bho::mysql::detail::async_quit_connection_erased(
  231. channel& chan,
  232. diagnostics& diag,
  233. any_void_handler handler
  234. )
  235. {
  236. async_quit_connection_impl(chan, diag, std::move(handler));
  237. }
  238. #endif