2
0
mirror of https://github.com/boostorg/mysql.git synced 2026-02-15 01:02:17 +00:00

Removed network_algorithms/common

This commit is contained in:
Ruben Perez
2022-08-07 23:45:19 +02:00
parent 7bac37a41f
commit af3c728f2a
17 changed files with 50 additions and 70 deletions

View File

@@ -8,7 +8,9 @@
#ifndef BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_CLOSE_CONNECTION_HPP
#define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_CLOSE_CONNECTION_HPP
#include <boost/mysql/detail/network_algorithms/common.hpp>
#include <boost/mysql/error.hpp>
#include <boost/mysql/detail/channel/channel.hpp>
namespace boost {
namespace mysql {

View File

@@ -8,7 +8,9 @@
#ifndef BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_CLOSE_STATEMENT_HPP
#define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_CLOSE_STATEMENT_HPP
#include <boost/mysql/detail/network_algorithms/common.hpp>
#include <boost/mysql/error.hpp>
#include <boost/mysql/detail/channel/channel.hpp>
namespace boost {
namespace mysql {

View File

@@ -1,31 +0,0 @@
//
// Copyright (c) 2019-2022 Ruben Perez Hidalgo (rubenperez038 at gmail dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_COMMON_HPP
#define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_COMMON_HPP
#include <boost/mysql/error.hpp>
#include <boost/mysql/field_metadata.hpp>
#include <boost/mysql/detail/channel/channel.hpp>
#include <boost/mysql/detail/protocol/common_messages.hpp>
namespace boost {
namespace mysql {
namespace detail {
using deserialize_row_fn = error_code (*)(
deserialization_context&,
const std::vector<field_metadata>&,
std::vector<value>&
);
} // detail
} // mysql
} // boost
#endif /* INCLUDE_BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_COMMON_HPP_ */

View File

@@ -8,8 +8,9 @@
#ifndef BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_CONNECT_HPP
#define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_CONNECT_HPP
#include <boost/mysql/detail/network_algorithms/common.hpp>
#include <boost/mysql/connection_params.hpp>
#include <boost/mysql/error.hpp>
#include <boost/mysql/detail/channel/channel.hpp>
namespace boost {
namespace mysql {

View File

@@ -8,9 +8,11 @@
#ifndef BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_EXECUTE_GENERIC_HPP
#define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_EXECUTE_GENERIC_HPP
#include <boost/mysql/detail/network_algorithms/common.hpp>
#include <boost/mysql/error.hpp>
#include <boost/mysql/resultset.hpp>
#include <boost/utility/string_view.hpp>
#include <boost/mysql/detail/channel/channel.hpp>
#include <boost/mysql/detail/protocol/resultset_encoding.hpp>
namespace boost {
namespace mysql {
@@ -18,7 +20,7 @@ namespace detail {
template <class Stream, class Serializable>
void execute_generic(
deserialize_row_fn deserializer,
resultset_encoding encoding,
channel<Stream>& channel,
const Serializable& request,
resultset& output,
@@ -29,7 +31,7 @@ void execute_generic(
template <class Stream, class Serializable, class CompletionToken>
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code))
async_execute_generic(
deserialize_row_fn deserializer,
resultset_encoding encoding,
channel<Stream>& chan,
const Serializable& request,
resultset& output,

View File

@@ -8,10 +8,12 @@
#ifndef BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_EXECUTE_QUERY_HPP
#define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_EXECUTE_QUERY_HPP
#include <boost/mysql/detail/network_algorithms/common.hpp>
#include <boost/mysql/error.hpp>
#include <boost/mysql/resultset.hpp>
#include <boost/mysql/detail/channel/channel.hpp>
#include <boost/utility/string_view.hpp>
namespace boost {
namespace mysql {
namespace detail {

View File

@@ -8,11 +8,10 @@
#ifndef BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_EXECUTE_STATEMENT_HPP
#define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_EXECUTE_STATEMENT_HPP
#include <boost/mysql/detail/network_algorithms/common.hpp>
#include <boost/mysql/error.hpp>
#include <boost/mysql/resultset.hpp>
#include <boost/mysql/value.hpp>
#include <boost/mysql/prepared_statement.hpp>
#include <boost/mysql/execute_params.hpp>
#include <boost/mysql/detail/channel/channel.hpp>
namespace boost {
namespace mysql {

View File

@@ -8,12 +8,10 @@
#ifndef BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_HANDSHAKE_HPP
#define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_HANDSHAKE_HPP
#include <boost/utility/string_view.hpp>
#include <boost/mysql/detail/network_algorithms/common.hpp>
#include <boost/mysql/error.hpp>
#include <boost/mysql/detail/channel/channel.hpp>
#include <boost/mysql/detail/protocol/protocol_types.hpp>
#include <boost/mysql/connection_params.hpp>
#include <boost/mysql/collation.hpp>
namespace boost {
namespace mysql {

View File

@@ -10,11 +10,11 @@
#pragma once
#include <boost/mysql/detail/network_algorithms/common.hpp>
#include <boost/mysql/detail/network_algorithms/execute_generic.hpp>
#include <boost/mysql/detail/auxiliar/bytestring.hpp>
#include <boost/mysql/detail/protocol/capabilities.hpp>
#include <boost/mysql/detail/protocol/common_messages.hpp>
#include <boost/mysql/detail/protocol/resultset_encoding.hpp>
#include <boost/mysql/error.hpp>
#include <boost/mysql/resultset.hpp>
#include <boost/asio/buffer.hpp>
@@ -51,10 +51,10 @@ public:
template <class Serializable>
void process_request(
const Serializable& request,
deserialize_row_fn deserialize_fn
resultset_encoding encoding
)
{
output_.reset(deserialize_fn);
output_.reset(encoding);
serialize_message(request, caps_, write_buffer_);
}
@@ -221,7 +221,7 @@ struct execute_generic_op : boost::asio::coroutine
template <class Stream, class Serializable>
void boost::mysql::detail::execute_generic(
deserialize_row_fn deserializer,
resultset_encoding encoding,
channel<Stream>& channel,
const Serializable& request,
resultset& output,
@@ -236,7 +236,7 @@ void boost::mysql::detail::execute_generic(
channel.shared_buffer(),
channel.current_capabilities()
);
processor.process_request(request, deserializer);
processor.process_request(request, encoding);
// Send it
channel.write(channel.shared_buffer(), processor.sequence_number(), err);
@@ -282,7 +282,7 @@ BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(
void(boost::mysql::error_code)
)
boost::mysql::detail::async_execute_generic(
deserialize_row_fn deserializer,
resultset_encoding encoding,
channel<Stream>& channel,
const Serializable& request,
resultset& output,
@@ -296,7 +296,7 @@ boost::mysql::detail::async_execute_generic(
channel.shared_buffer(),
channel.current_capabilities()
);
processor.process_request(request, deserializer);
processor.process_request(request, encoding);
return boost::asio::async_compose<CompletionToken, void(error_code)>(
execute_generic_op<Stream>(channel, processor),
token,

View File

@@ -11,8 +11,8 @@
#pragma once
#include <boost/mysql/detail/network_algorithms/execute_query.hpp>
#include <boost/mysql/detail/protocol/text_deserialization.hpp>
#include <boost/mysql/detail/protocol/query_messages.hpp>
#include <boost/mysql/detail/protocol/resultset_encoding.hpp>
#include <boost/mysql/detail/network_algorithms/execute_generic.hpp>
template <class Stream>
@@ -26,7 +26,7 @@ void boost::mysql::detail::execute_query(
{
com_query_packet request { string_eof(query) };
execute_generic(
&deserialize_text_row,
resultset_encoding::text,
channel,
request,
output,
@@ -51,7 +51,7 @@ boost::mysql::detail::async_execute_query(
{
com_query_packet request { string_eof(query) };
return async_execute_generic(
&deserialize_text_row,
resultset_encoding::text,
chan,
request,
output,

View File

@@ -13,8 +13,8 @@
#include <boost/mysql/resultset.hpp>
#include <boost/mysql/execute_params.hpp>
#include <boost/mysql/detail/network_algorithms/execute_statement.hpp>
#include <boost/mysql/detail/protocol/binary_deserialization.hpp>
#include <boost/mysql/detail/protocol/prepared_statement_messages.hpp>
#include <boost/mysql/detail/protocol/resultset_encoding.hpp>
#include <boost/mysql/detail/network_algorithms/execute_generic.hpp>
namespace boost {
@@ -51,7 +51,7 @@ void boost::mysql::detail::execute_statement(
)
{
execute_generic(
&deserialize_binary_row,
resultset_encoding::binary,
chan,
make_stmt_execute_packet(params),
output,
@@ -74,7 +74,7 @@ boost::mysql::detail::async_execute_statement(
)
{
return async_execute_generic(
&deserialize_binary_row,
resultset_encoding::binary,
chan,
make_stmt_execute_packet(params),
output,

View File

@@ -8,8 +8,11 @@
#ifndef BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_PREPARE_STATEMENT_HPP
#define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_PREPARE_STATEMENT_HPP
#include <boost/mysql/detail/network_algorithms/common.hpp>
#include <boost/mysql/error.hpp>
#include <boost/mysql/prepared_statement.hpp>
#include <boost/utility/string_view.hpp>
#include <boost/mysql/detail/channel/channel.hpp>
namespace boost {
namespace mysql {

View File

@@ -8,7 +8,9 @@
#ifndef BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_QUIT_CONNECTION_HPP
#define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_QUIT_CONNECTION_HPP
#include <boost/mysql/detail/network_algorithms/common.hpp>
#include <boost/mysql/error.hpp>
#include <boost/mysql/detail/channel/channel.hpp>
namespace boost {
namespace mysql {

View File

@@ -8,11 +8,11 @@
#ifndef BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_READ_ALL_ROWS_HPP
#define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_READ_ALL_ROWS_HPP
#include <boost/mysql/detail/network_algorithms/common.hpp>
#include <boost/mysql/error.hpp>
#include <boost/mysql/detail/channel/channel.hpp>
#include <boost/mysql/resultset.hpp>
#include <boost/mysql/row.hpp>
#include <boost/utility/string_view.hpp>
#include <vector>
namespace boost {
namespace mysql {

View File

@@ -8,11 +8,11 @@
#ifndef BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_READ_ONE_ROW_HPP
#define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_READ_ONE_ROW_HPP
#include <boost/mysql/detail/network_algorithms/common.hpp>
#include <boost/mysql/error.hpp>
#include <boost/mysql/detail/channel/channel.hpp>
#include <boost/mysql/resultset.hpp>
#include <boost/mysql/row.hpp>
#include <boost/utility/string_view.hpp>
#include <vector>
namespace boost {
namespace mysql {

View File

@@ -8,10 +8,11 @@
#ifndef BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_READ_SOME_ROWS_HPP
#define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_READ_SOME_ROWS_HPP
#include <boost/mysql/detail/network_algorithms/common.hpp>
#include <boost/mysql/error.hpp>
#include <boost/mysql/detail/channel/channel.hpp>
#include <boost/mysql/resultset.hpp>
#include <boost/mysql/row.hpp>
#include <vector>
namespace boost {
namespace mysql {

View File

@@ -9,7 +9,6 @@
#include <boost/mysql/detail/protocol/text_deserialization.hpp>
#include <boost/mysql/detail/protocol/binary_deserialization.hpp>
#include <boost/mysql/detail/network_algorithms/common.hpp> // for deserialize_row_fn
#include "test_common.hpp"
#include <boost/test/data/monomorphic/collection.hpp>
#include <boost/test/data/test_case.hpp>