mirror of
https://github.com/boostorg/mysql.git
synced 2026-02-15 01:02:17 +00:00
* SSL/TLS rework * Unified connection object * New prepared_statement::execute interface * New resultset::read_one mechanic * Unified row object * null_t type * Travis to GitHub actions migration * Integration test rework
52 lines
1.2 KiB
C++
52 lines
1.2 KiB
C++
//
|
|
// 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_TEST_INTEGRATION_UTILS_INCLUDE_GET_ENDPOINT_HPP
|
|
#define BOOST_MYSQL_TEST_INTEGRATION_UTILS_INCLUDE_GET_ENDPOINT_HPP
|
|
|
|
#include "er_endpoint.hpp"
|
|
#include <boost/asio/ip/tcp.hpp>
|
|
#include <boost/asio/local/stream_protocol.hpp>
|
|
#include <stdexcept>
|
|
#include <utility>
|
|
|
|
namespace boost {
|
|
namespace mysql {
|
|
namespace test {
|
|
|
|
template <class Protocol>
|
|
struct endpoint_getter;
|
|
|
|
template <>
|
|
struct endpoint_getter<boost::asio::ip::tcp>
|
|
{
|
|
boost::asio::ip::tcp::endpoint operator()(er_endpoint kind);
|
|
};
|
|
|
|
#ifdef BOOST_ASIO_HAS_LOCAL_SOCKETS
|
|
template <>
|
|
struct endpoint_getter<boost::asio::local::stream_protocol>
|
|
{
|
|
boost::asio::local::stream_protocol::endpoint operator()(er_endpoint kind);
|
|
};
|
|
#endif
|
|
|
|
template <class Stream>
|
|
typename Stream::lowest_layer_type::endpoint_type get_endpoint(
|
|
er_endpoint kind
|
|
)
|
|
{
|
|
return endpoint_getter<typename Stream::lowest_layer_type::protocol_type>()(kind);
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
#endif
|