mirror of
https://github.com/boostorg/beast.git
synced 2025-08-02 06:15:24 +02:00
Add stream_traits.hpp:
get_lowest_layer, lowest_layer_type are located here now.
This commit is contained in:
@@ -3,6 +3,7 @@ Version 210:
|
|||||||
* Tidy up read implementation
|
* Tidy up read implementation
|
||||||
* Fix stable_async_op_base javadoc
|
* Fix stable_async_op_base javadoc
|
||||||
* Better handling of stream timeouts
|
* Better handling of stream timeouts
|
||||||
|
* Add stream_traits.hpp
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@@ -33,7 +33,6 @@
|
|||||||
#include <boost/beast/core/file_win32.hpp>
|
#include <boost/beast/core/file_win32.hpp>
|
||||||
#include <boost/beast/core/flat_buffer.hpp>
|
#include <boost/beast/core/flat_buffer.hpp>
|
||||||
#include <boost/beast/core/flat_static_buffer.hpp>
|
#include <boost/beast/core/flat_static_buffer.hpp>
|
||||||
#include <boost/beast/core/get_lowest_layer.hpp>
|
|
||||||
#include <boost/beast/core/handler_ptr.hpp>
|
#include <boost/beast/core/handler_ptr.hpp>
|
||||||
#include <boost/beast/core/make_printable.hpp>
|
#include <boost/beast/core/make_printable.hpp>
|
||||||
#include <boost/beast/core/multi_buffer.hpp>
|
#include <boost/beast/core/multi_buffer.hpp>
|
||||||
@@ -42,6 +41,7 @@
|
|||||||
#include <boost/beast/core/span.hpp>
|
#include <boost/beast/core/span.hpp>
|
||||||
#include <boost/beast/core/static_buffer.hpp>
|
#include <boost/beast/core/static_buffer.hpp>
|
||||||
#include <boost/beast/core/static_string.hpp>
|
#include <boost/beast/core/static_string.hpp>
|
||||||
|
#include <boost/beast/core/stream_traits.hpp>
|
||||||
#include <boost/beast/core/string.hpp>
|
#include <boost/beast/core/string.hpp>
|
||||||
#include <boost/beast/core/string_param.hpp>
|
#include <boost/beast/core/string_param.hpp>
|
||||||
#include <boost/beast/core/timeout_stream.hpp>
|
#include <boost/beast/core/timeout_stream.hpp>
|
||||||
|
@@ -7,8 +7,8 @@
|
|||||||
// Official repository: https://github.com/boostorg/beast
|
// Official repository: https://github.com/boostorg/beast
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef BOOST_BEAST_DETAIL_GET_LOWEST_LAYER_HPP
|
#ifndef BOOST_BEAST_DETAIL_STREAM_TRAITS_HPP
|
||||||
#define BOOST_BEAST_DETAIL_GET_LOWEST_LAYER_HPP
|
#define BOOST_BEAST_DETAIL_STREAM_TRAITS_HPP
|
||||||
|
|
||||||
#include <boost/type_traits/make_void.hpp>
|
#include <boost/type_traits/make_void.hpp>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
@@ -17,6 +17,13 @@ namespace boost {
|
|||||||
namespace beast {
|
namespace beast {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// get_lowest_layer
|
||||||
|
// lowest_layer_type
|
||||||
|
// detail::has_next_layer
|
||||||
|
//
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
std::false_type has_next_layer_impl(void*) {}
|
std::false_type has_next_layer_impl(void*) {}
|
||||||
|
|
||||||
@@ -29,8 +36,6 @@ auto has_next_layer_impl(decltype(nullptr)) ->
|
|||||||
template <class T>
|
template <class T>
|
||||||
using has_next_layer = decltype(has_next_layer_impl<T>(nullptr));
|
using has_next_layer = decltype(has_next_layer_impl<T>(nullptr));
|
||||||
|
|
||||||
//---
|
|
||||||
|
|
||||||
template<class T, bool = has_next_layer<T>::value>
|
template<class T, bool = has_next_layer<T>::value>
|
||||||
struct lowest_layer_type_impl
|
struct lowest_layer_type_impl
|
||||||
{
|
{
|
||||||
@@ -48,8 +53,6 @@ template<class T>
|
|||||||
using lowest_layer_type = typename
|
using lowest_layer_type = typename
|
||||||
lowest_layer_type_impl<T>::type;
|
lowest_layer_type_impl<T>::type;
|
||||||
|
|
||||||
//---
|
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
T&
|
T&
|
||||||
get_lowest_layer_impl(
|
get_lowest_layer_impl(
|
||||||
@@ -68,6 +71,8 @@ get_lowest_layer_impl(
|
|||||||
decltype(t.next_layer())>::type>{});
|
decltype(t.next_layer())>::type>{});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
} // detail
|
} // detail
|
||||||
} // beast
|
} // beast
|
||||||
} // boost
|
} // boost
|
@@ -7,11 +7,11 @@
|
|||||||
// Official repository: https://github.com/boostorg/beast
|
// Official repository: https://github.com/boostorg/beast
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef BOOST_BEAST_GET_LOWEST_LAYER_HPP
|
#ifndef BOOST_BEAST_STREAM_TRAITS_HPP
|
||||||
#define BOOST_BEAST_GET_LOWEST_LAYER_HPP
|
#define BOOST_BEAST_STREAM_TRAITS_HPP
|
||||||
|
|
||||||
#include <boost/beast/core/detail/config.hpp>
|
#include <boost/beast/core/detail/config.hpp>
|
||||||
#include <boost/beast/core/detail/get_lowest_layer.hpp>
|
#include <boost/beast/core/detail/stream_traits.hpp>
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
namespace beast {
|
namespace beast {
|
@@ -50,7 +50,6 @@ add_executable (tests-beast-core
|
|||||||
file_win32.cpp
|
file_win32.cpp
|
||||||
flat_buffer.cpp
|
flat_buffer.cpp
|
||||||
flat_static_buffer.cpp
|
flat_static_buffer.cpp
|
||||||
get_lowest_layer.cpp
|
|
||||||
handler_ptr.cpp
|
handler_ptr.cpp
|
||||||
make_printable.cpp
|
make_printable.cpp
|
||||||
multi_buffer.cpp
|
multi_buffer.cpp
|
||||||
@@ -60,6 +59,7 @@ add_executable (tests-beast-core
|
|||||||
span.cpp
|
span.cpp
|
||||||
static_buffer.cpp
|
static_buffer.cpp
|
||||||
static_string.cpp
|
static_string.cpp
|
||||||
|
stream_traits.cpp
|
||||||
string.cpp
|
string.cpp
|
||||||
string_param.cpp
|
string_param.cpp
|
||||||
timeout_stream.cpp
|
timeout_stream.cpp
|
||||||
|
@@ -38,7 +38,6 @@ local SOURCES =
|
|||||||
file_win32.cpp
|
file_win32.cpp
|
||||||
flat_buffer.cpp
|
flat_buffer.cpp
|
||||||
flat_static_buffer.cpp
|
flat_static_buffer.cpp
|
||||||
get_lowest_layer.cpp
|
|
||||||
handler_ptr.cpp
|
handler_ptr.cpp
|
||||||
make_printable.cpp
|
make_printable.cpp
|
||||||
multi_buffer.cpp
|
multi_buffer.cpp
|
||||||
@@ -48,6 +47,7 @@ local SOURCES =
|
|||||||
span.cpp
|
span.cpp
|
||||||
static_buffer.cpp
|
static_buffer.cpp
|
||||||
static_string.cpp
|
static_string.cpp
|
||||||
|
stream_traits.cpp
|
||||||
string.cpp
|
string.cpp
|
||||||
string_param.cpp
|
string_param.cpp
|
||||||
timeout_stream.cpp
|
timeout_stream.cpp
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
#include <boost/beast/_experimental/unit_test/suite.hpp>
|
#include <boost/beast/_experimental/unit_test/suite.hpp>
|
||||||
#include <boost/beast/_experimental/test/stream.hpp>
|
#include <boost/beast/_experimental/test/stream.hpp>
|
||||||
#include <boost/beast/core/get_lowest_layer.hpp>
|
#include <boost/beast/core/stream_traits.hpp>
|
||||||
#include <boost/beast/core/string.hpp>
|
#include <boost/beast/core/string.hpp>
|
||||||
|
|
||||||
#include <boost/asio/ip/tcp.hpp>
|
#include <boost/asio/ip/tcp.hpp>
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
// Test that header file is self-contained.
|
// Test that header file is self-contained.
|
||||||
#include <boost/beast/core/get_lowest_layer.hpp>
|
#include <boost/beast/core/stream_traits.hpp>
|
||||||
|
|
||||||
#include <boost/beast/_experimental/unit_test/suite.hpp>
|
#include <boost/beast/_experimental/unit_test/suite.hpp>
|
||||||
#include <boost/beast/core/error.hpp>
|
#include <boost/beast/core/error.hpp>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
namespace boost {
|
namespace boost {
|
||||||
namespace beast {
|
namespace beast {
|
||||||
|
|
||||||
class get_lowest_layer_test
|
class stream_traits_test
|
||||||
: public beast::unit_test::suite
|
: public beast::unit_test::suite
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -186,7 +186,7 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
BEAST_DEFINE_TESTSUITE(beast,core,get_lowest_layer);
|
BEAST_DEFINE_TESTSUITE(beast,core,stream_traits);
|
||||||
|
|
||||||
} // beast
|
} // beast
|
||||||
} // boost
|
} // boost
|
Reference in New Issue
Block a user