mirror of
https://github.com/boostorg/beast.git
synced 2025-08-01 05:44:38 +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
|
||||
* Fix stable_async_op_base javadoc
|
||||
* Better handling of stream timeouts
|
||||
* Add stream_traits.hpp
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
@@ -33,7 +33,6 @@
|
||||
#include <boost/beast/core/file_win32.hpp>
|
||||
#include <boost/beast/core/flat_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/make_printable.hpp>
|
||||
#include <boost/beast/core/multi_buffer.hpp>
|
||||
@@ -42,6 +41,7 @@
|
||||
#include <boost/beast/core/span.hpp>
|
||||
#include <boost/beast/core/static_buffer.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_param.hpp>
|
||||
#include <boost/beast/core/timeout_stream.hpp>
|
||||
|
@@ -7,8 +7,8 @@
|
||||
// Official repository: https://github.com/boostorg/beast
|
||||
//
|
||||
|
||||
#ifndef BOOST_BEAST_DETAIL_GET_LOWEST_LAYER_HPP
|
||||
#define BOOST_BEAST_DETAIL_GET_LOWEST_LAYER_HPP
|
||||
#ifndef BOOST_BEAST_DETAIL_STREAM_TRAITS_HPP
|
||||
#define BOOST_BEAST_DETAIL_STREAM_TRAITS_HPP
|
||||
|
||||
#include <boost/type_traits/make_void.hpp>
|
||||
#include <type_traits>
|
||||
@@ -17,6 +17,13 @@ namespace boost {
|
||||
namespace beast {
|
||||
namespace detail {
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//
|
||||
// get_lowest_layer
|
||||
// lowest_layer_type
|
||||
// detail::has_next_layer
|
||||
//
|
||||
|
||||
template <class T>
|
||||
std::false_type has_next_layer_impl(void*) {}
|
||||
|
||||
@@ -29,8 +36,6 @@ auto has_next_layer_impl(decltype(nullptr)) ->
|
||||
template <class T>
|
||||
using has_next_layer = decltype(has_next_layer_impl<T>(nullptr));
|
||||
|
||||
//---
|
||||
|
||||
template<class T, bool = has_next_layer<T>::value>
|
||||
struct lowest_layer_type_impl
|
||||
{
|
||||
@@ -48,8 +53,6 @@ template<class T>
|
||||
using lowest_layer_type = typename
|
||||
lowest_layer_type_impl<T>::type;
|
||||
|
||||
//---
|
||||
|
||||
template<class T>
|
||||
T&
|
||||
get_lowest_layer_impl(
|
||||
@@ -68,6 +71,8 @@ get_lowest_layer_impl(
|
||||
decltype(t.next_layer())>::type>{});
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
} // detail
|
||||
} // beast
|
||||
} // boost
|
@@ -7,11 +7,11 @@
|
||||
// Official repository: https://github.com/boostorg/beast
|
||||
//
|
||||
|
||||
#ifndef BOOST_BEAST_GET_LOWEST_LAYER_HPP
|
||||
#define BOOST_BEAST_GET_LOWEST_LAYER_HPP
|
||||
#ifndef BOOST_BEAST_STREAM_TRAITS_HPP
|
||||
#define BOOST_BEAST_STREAM_TRAITS_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 beast {
|
@@ -50,7 +50,6 @@ add_executable (tests-beast-core
|
||||
file_win32.cpp
|
||||
flat_buffer.cpp
|
||||
flat_static_buffer.cpp
|
||||
get_lowest_layer.cpp
|
||||
handler_ptr.cpp
|
||||
make_printable.cpp
|
||||
multi_buffer.cpp
|
||||
@@ -60,6 +59,7 @@ add_executable (tests-beast-core
|
||||
span.cpp
|
||||
static_buffer.cpp
|
||||
static_string.cpp
|
||||
stream_traits.cpp
|
||||
string.cpp
|
||||
string_param.cpp
|
||||
timeout_stream.cpp
|
||||
|
@@ -38,7 +38,6 @@ local SOURCES =
|
||||
file_win32.cpp
|
||||
flat_buffer.cpp
|
||||
flat_static_buffer.cpp
|
||||
get_lowest_layer.cpp
|
||||
handler_ptr.cpp
|
||||
make_printable.cpp
|
||||
multi_buffer.cpp
|
||||
@@ -48,6 +47,7 @@ local SOURCES =
|
||||
span.cpp
|
||||
static_buffer.cpp
|
||||
static_string.cpp
|
||||
stream_traits.cpp
|
||||
string.cpp
|
||||
string_param.cpp
|
||||
timeout_stream.cpp
|
||||
|
@@ -12,7 +12,7 @@
|
||||
|
||||
#include <boost/beast/_experimental/unit_test/suite.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/asio/ip/tcp.hpp>
|
||||
|
@@ -8,7 +8,7 @@
|
||||
//
|
||||
|
||||
// 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/core/error.hpp>
|
||||
@@ -17,7 +17,7 @@
|
||||
namespace boost {
|
||||
namespace beast {
|
||||
|
||||
class get_lowest_layer_test
|
||||
class stream_traits_test
|
||||
: public beast::unit_test::suite
|
||||
{
|
||||
public:
|
||||
@@ -186,7 +186,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
BEAST_DEFINE_TESTSUITE(beast,core,get_lowest_layer);
|
||||
BEAST_DEFINE_TESTSUITE(beast,core,stream_traits);
|
||||
|
||||
} // beast
|
||||
} // boost
|
Reference in New Issue
Block a user