forked from boostorg/beast
lowest_layer is removed (API Change):
The nested function lowest_layer and nested type lowest_layer_type are removed from all stream layers. Actions Required: * Remove lowest_layer and lowest_layer_type from user-defined streams. * Use the get_lowest_layer free function and the lowest_layer_type trait as needed.
This commit is contained in:
1 parent
29f838b9d9
commit
60c96104ec
13 files changed
+11
-279
No files matched your search
@@ -102,9 +102,6 @@ public:
|
||||
using next_layer_type =
|
||||
typename std::remove_reference<NextLayer>::type;
|
||||
|
||||
/// The type of the lowest layer.
|
||||
using lowest_layer_type = boost::beast::get_lowest_layer<next_layer_type>;
|
||||
|
||||
/// The type of the executor associated with the object.
|
||||
using executor_type = typename next_layer_type::executor_type;
|
||||
|
||||
@@ -171,34 +168,6 @@ public:
|
||||
return stream_;
|
||||
}
|
||||
|
||||
/** Get a reference to the lowest layer
|
||||
|
||||
This function returns a reference to the lowest layer
|
||||
in a stack of stream layers.
|
||||
|
||||
@return A reference to the lowest layer in the stack of
|
||||
stream layers.
|
||||
*/
|
||||
lowest_layer_type&
|
||||
lowest_layer() noexcept
|
||||
{
|
||||
return stream_.lowest_layer();
|
||||
}
|
||||
|
||||
/** Get a reference to the lowest layer
|
||||
|
||||
This function returns a reference to the lowest layer
|
||||
in a stack of stream layers.
|
||||
|
||||
@return A reference to the lowest layer in the stack of
|
||||
stream layers. Ownership is not transferred to the caller.
|
||||
*/
|
||||
lowest_layer_type const&
|
||||
lowest_layer() const noexcept
|
||||
{
|
||||
return stream_.lowest_layer();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
/** Read some data from the stream.
|
||||
|
||||
@@ -84,9 +84,6 @@ public:
|
||||
/// The type of the next layer.
|
||||
using next_layer_type = typename ssl_stream_type::next_layer_type;
|
||||
|
||||
/// The type of the lowest layer.
|
||||
using lowest_layer_type = typename ssl_stream_type::lowest_layer_type;
|
||||
|
||||
/// The type of the executor associated with the object.
|
||||
using executor_type = typename stream_type::executor_type;
|
||||
|
||||
@@ -185,35 +182,7 @@ public:
|
||||
return p_->next_layer().next_layer();
|
||||
}
|
||||
|
||||
/** Get a reference to the lowest layer.
|
||||
|
||||
This function returns a reference to the lowest layer in a stack of stream
|
||||
layers.
|
||||
|
||||
@return A reference to the lowest layer in the stack of stream layers.
|
||||
Ownership is not transferred to the caller.
|
||||
*/
|
||||
lowest_layer_type&
|
||||
lowest_layer() noexcept
|
||||
{
|
||||
return p_->lowest_layer();
|
||||
}
|
||||
|
||||
/** Get a reference to the lowest layer.
|
||||
|
||||
This function returns a reference to the lowest layer in a stack of stream
|
||||
layers.
|
||||
|
||||
@return A reference to the lowest layer in the stack of stream layers.
|
||||
Ownership is not transferred to the caller.
|
||||
*/
|
||||
lowest_layer_type const&
|
||||
lowest_layer() const noexcept
|
||||
{
|
||||
return p_->lowest_layer();
|
||||
}
|
||||
|
||||
/** Set the peer verification mode.
|
||||
/** Set the peer verification mode.
|
||||
|
||||
This function may be used to configure the peer verification mode used by
|
||||
the stream. The new mode will override the mode inherited from the context.
|
||||
|
||||
@@ -87,10 +87,6 @@ public:
|
||||
using next_layer_type =
|
||||
typename std::remove_reference<NextLayer>::type;
|
||||
|
||||
/// The type of the lowest layer.
|
||||
using lowest_layer_type =
|
||||
get_lowest_layer<next_layer_type>;
|
||||
|
||||
/// The type of the executor associated with the object.
|
||||
using executor_type = typename next_layer_type::executor_type;
|
||||
|
||||
@@ -157,34 +153,6 @@ public:
|
||||
return stream_;
|
||||
}
|
||||
|
||||
/** Get a reference to the lowest layer
|
||||
|
||||
This function returns a reference to the lowest layer
|
||||
in a stack of stream layers.
|
||||
|
||||
@return A reference to the lowest layer in the stack of
|
||||
stream layers.
|
||||
*/
|
||||
lowest_layer_type&
|
||||
lowest_layer()
|
||||
{
|
||||
return stream_.lowest_layer();
|
||||
}
|
||||
|
||||
/** Get a reference to the lowest layer
|
||||
|
||||
This function returns a reference to the lowest layer
|
||||
in a stack of stream layers.
|
||||
|
||||
@return A reference to the lowest layer in the stack of
|
||||
stream layers. Ownership is not transferred to the caller.
|
||||
*/
|
||||
lowest_layer_type const&
|
||||
lowest_layer() const
|
||||
{
|
||||
return stream_.lowest_layer();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
/** Read some data from the stream.
|
||||
|
||||
@@ -165,9 +165,6 @@ class stream
|
||||
public:
|
||||
using buffer_type = flat_buffer;
|
||||
|
||||
/// The type of the lowest layer.
|
||||
using lowest_layer_type = stream;
|
||||
|
||||
/** Destructor
|
||||
|
||||
If an asynchronous read operation is pending, it will
|
||||
@@ -278,34 +275,6 @@ public:
|
||||
return in_->ioc.get_executor();
|
||||
};
|
||||
|
||||
/** Get a reference to the lowest layer
|
||||
|
||||
This function returns a reference to the lowest layer
|
||||
in a stack of stream layers.
|
||||
|
||||
@return A reference to the lowest layer in the stack of
|
||||
stream layers.
|
||||
*/
|
||||
lowest_layer_type&
|
||||
lowest_layer() noexcept
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
/** Get a reference to the lowest layer
|
||||
|
||||
This function returns a reference to the lowest layer
|
||||
in a stack of stream layers.
|
||||
|
||||
@return A reference to the lowest layer in the stack of
|
||||
stream layers. Ownership is not transferred to the caller.
|
||||
*/
|
||||
lowest_layer_type const&
|
||||
lowest_layer() const noexcept
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
/// Set the maximum number of bytes returned by read_some
|
||||
void
|
||||
read_size(std::size_t n) noexcept
|
||||
|
||||
@@ -111,9 +111,6 @@ public:
|
||||
using next_layer_type =
|
||||
typename std::remove_reference<Stream>::type;
|
||||
|
||||
/// The type of the lowest layer.
|
||||
using lowest_layer_type = get_lowest_layer<next_layer_type>;
|
||||
|
||||
/** Move constructor.
|
||||
|
||||
@note The behavior of move assignment on or from streams
|
||||
@@ -150,20 +147,6 @@ public:
|
||||
return next_layer_;
|
||||
}
|
||||
|
||||
/// Get a reference to the lowest layer.
|
||||
lowest_layer_type&
|
||||
lowest_layer() noexcept
|
||||
{
|
||||
return next_layer_.lowest_layer();
|
||||
}
|
||||
|
||||
/// Get a const reference to the lowest layer.
|
||||
lowest_layer_type const&
|
||||
lowest_layer() const noexcept
|
||||
{
|
||||
return next_layer_.lowest_layer();
|
||||
}
|
||||
|
||||
using executor_type =
|
||||
detail::get_executor_type<next_layer_type>;
|
||||
|
||||
|
||||
@@ -161,21 +161,6 @@ struct is_contiguous_container<T, E, void_t<
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
template<class T, class = void>
|
||||
struct get_lowest_layer_helper
|
||||
{
|
||||
using type = T;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct get_lowest_layer_helper<T,
|
||||
void_t<typename T::lowest_layer_type>>
|
||||
{
|
||||
using type = typename T::lowest_layer_type;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
//
|
||||
// buffer concepts
|
||||
//
|
||||
|
||||
@@ -121,41 +121,6 @@ struct has_get_executor<T, beast::detail::void_t<decltype(
|
||||
std::declval<T&>().get_executor())>> : std::true_type {};
|
||||
#endif
|
||||
|
||||
/** Alias for `T::lowest_layer_type` if it exists, else `T`
|
||||
|
||||
This will be a type alias for `T::lowest_layer_type`
|
||||
if it exists, else it will be an alias for `T`.
|
||||
|
||||
@par Example
|
||||
|
||||
Declaring a wrapper:
|
||||
|
||||
@code
|
||||
template<class Stream>
|
||||
struct stream_wrapper
|
||||
{
|
||||
using next_layer_type = typename std::remove_reference<Stream>::type;
|
||||
using lowest_layer_type = get_lowest_layer<stream_type>;
|
||||
};
|
||||
@endcode
|
||||
|
||||
Defining a metafunction:
|
||||
|
||||
@code
|
||||
/// Alias for `std::true_type` if `T` wraps another stream
|
||||
template<class T>
|
||||
using is_stream_wrapper : std::integral_constant<bool,
|
||||
! std::is_same<T, get_lowest_layer<T>>::value> {};
|
||||
@endcode
|
||||
*/
|
||||
#if BOOST_BEAST_DOXYGEN
|
||||
template<class T>
|
||||
struct get_lowest_layer;
|
||||
#else
|
||||
template<class T>
|
||||
using get_lowest_layer = typename detail::get_lowest_layer_helper<T>::type;
|
||||
#endif
|
||||
|
||||
/** Determine if `T` meets the requirements of @b AsyncReadStream.
|
||||
|
||||
Metafunctions are used to perform compile time checking of template
|
||||
|
||||
@@ -79,24 +79,6 @@ next_layer() const noexcept ->
|
||||
return impl_->stream;
|
||||
}
|
||||
|
||||
template<class NextLayer, bool deflateSupported>
|
||||
auto
|
||||
stream<NextLayer, deflateSupported>::
|
||||
lowest_layer() noexcept ->
|
||||
lowest_layer_type&
|
||||
{
|
||||
return impl_->stream.lowest_layer();
|
||||
}
|
||||
|
||||
template<class NextLayer, bool deflateSupported>
|
||||
auto
|
||||
stream<NextLayer, deflateSupported>::
|
||||
lowest_layer() const noexcept ->
|
||||
lowest_layer_type const&
|
||||
{
|
||||
return impl_->stream.lowest_layer();
|
||||
}
|
||||
|
||||
template<class NextLayer, bool deflateSupported>
|
||||
bool
|
||||
stream<NextLayer, deflateSupported>::
|
||||
|
||||
@@ -161,9 +161,6 @@ public:
|
||||
using next_layer_type =
|
||||
typename std::remove_reference<NextLayer>::type;
|
||||
|
||||
/// The type of the lowest layer.
|
||||
using lowest_layer_type = get_lowest_layer<next_layer_type>;
|
||||
|
||||
/// The type of the executor associated with the object.
|
||||
using executor_type = typename next_layer_type::executor_type;
|
||||
|
||||
@@ -245,30 +242,6 @@ public:
|
||||
next_layer_type const&
|
||||
next_layer() const noexcept;
|
||||
|
||||
/** Get a reference to the lowest layer
|
||||
|
||||
This function returns a reference to the lowest layer
|
||||
in a stack of stream layers.
|
||||
|
||||
@return A reference to the lowest layer in the stack of
|
||||
stream layers.
|
||||
*/
|
||||
// DEPRECATED
|
||||
lowest_layer_type&
|
||||
lowest_layer() noexcept;
|
||||
|
||||
/** Get a reference to the lowest layer
|
||||
|
||||
This function returns a reference to the lowest layer
|
||||
in a stack of stream layers.
|
||||
|
||||
@return A reference to the lowest layer in the stack of
|
||||
stream layers. Ownership is not transferred to the caller.
|
||||
*/
|
||||
// DEPRECATED
|
||||
lowest_layer_type const&
|
||||
lowest_layer() const noexcept;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
//
|
||||
// Observers
|
||||
|
||||
Reference in new issue
Block a user