22#include <boost/asio.hpp>
89 using Base = boost::asio::posix::descriptor;
135 template<
typename Execution_context>
137 typename std::enable_if_t<std::is_convertible_v
139 boost::asio::execution_context&>>*
152 template<
typename Execution_context>
154 typename std::enable_if_t<std::is_convertible_v
156 boost::asio::execution_context&>>*
207 using Base::async_wait;
218template<
typename Execution_context>
221 typename std::enable_if_t<std::is_convertible_v<Execution_context&,
222 boost::asio::execution_context&>>*) :
223 Base(context, hndl.m_native_handle)
226 assert(!hndl.
null());
229template<
typename Execution_context>
231 (Execution_context& context,
232 typename std::enable_if_t<std::is_convertible_v<Execution_context&,
233 boost::asio::execution_context&>>*) :
Useful if using the sync_io pattern within a user event loop built on boost.asio (optionally with flo...
~Asio_waitable_native_handle()
Destructor that does not OS-close (in the Native_handle::close() sense) the stored native handle (if ...
Asio_waitable_native_handle(const Base::executor_type &ex, Native_handle hndl)
Construct boost.asio descriptor object such that one can async_wait() events on the given non-....
boost::asio::posix::descriptor Base
Short-hand for our base type; can be used for, e.g., Base::wait_write and Base::wait_read.
void assign(Native_handle hndl)
Loads value to be returned by native_handle().
Asio_waitable_native_handle(Asio_waitable_native_handle &&src)
Move-construct.
Native_handle native_handle()
Returns the same Native_handle as passed to original handle-loading ctor or assign(),...
Asio_waitable_native_handle & operator=(Asio_waitable_native_handle &&src)
Move-assign.
Contains common code, as well as important explanatory documentation in the following text,...
A monolayer-thin wrapper around a native handle, a/k/a descriptor a/k/a FD.
constexpr bool null() const noexcept
Returns true if and only if m_native_handle equals S_NULL_HANDLE.