externals: Update boost to 1.72 and add Boost Context

This commit is contained in:
Fernando Sahmkow 2020-02-10 12:31:57 -04:00
parent 5e8300b76a
commit 77abe07b3b
618 changed files with 96299 additions and 14263 deletions

View file

@ -55,6 +55,14 @@ public:
/// The type of the executor associated with the object.
typedef Executor executor_type;
/// Rebinds the handle type to another executor.
template <typename Executor1>
struct rebind_executor
{
/// The handle type when rebound to the specified executor.
typedef basic_object_handle<Executor1> other;
};
/// The native representation of a handle.
#if defined(GENERATING_DOCUMENTATION)
typedef implementation_defined native_handle_type;
@ -363,18 +371,17 @@ public:
* immediate completion, invocation of the handler will be performed in a
* manner equivalent to using boost::asio::post().
*/
template <typename WaitHandler>
BOOST_ASIO_INITFN_RESULT_TYPE(WaitHandler,
template <
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code))
WaitHandler BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(WaitHandler,
void (boost::system::error_code))
async_wait(BOOST_ASIO_MOVE_ARG(WaitHandler) handler)
async_wait(
BOOST_ASIO_MOVE_ARG(WaitHandler) handler
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
{
boost::asio::async_completion<WaitHandler,
void (boost::system::error_code)> init(handler);
impl_.get_service().async_wait(impl_.get_implementation(),
init.completion_handler, impl_.get_implementation_executor());
return init.result.get();
return async_initiate<WaitHandler, void (boost::system::error_code)>(
initiate_async_wait(this), handler);
}
private:
@ -382,6 +389,38 @@ private:
basic_object_handle(const basic_object_handle&) BOOST_ASIO_DELETED;
basic_object_handle& operator=(const basic_object_handle&) BOOST_ASIO_DELETED;
class initiate_async_wait
{
public:
typedef Executor executor_type;
explicit initiate_async_wait(basic_object_handle* self)
: self_(self)
{
}
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
{
return self_->get_executor();
}
template <typename WaitHandler>
void operator()(BOOST_ASIO_MOVE_ARG(WaitHandler) handler) const
{
// If you get an error on the following line it means that your handler
// does not meet the documented type requirements for a WaitHandler.
BOOST_ASIO_WAIT_HANDLER_CHECK(WaitHandler, handler) type_check;
detail::non_const_lvalue<WaitHandler> handler2(handler);
self_->impl_.get_service().async_wait(
self_->impl_.get_implementation(), handler2.value,
self_->impl_.get_implementation_executor());
}
private:
basic_object_handle* self_;
};
boost::asio::detail::io_object_impl<
boost::asio::detail::win_object_handle_service, Executor> impl_;
};

View file

@ -58,6 +58,14 @@ public:
/// The type of the executor associated with the object.
typedef Executor executor_type;
/// Rebinds the handle type to another executor.
template <typename Executor1>
struct rebind_executor
{
/// The handle type when rebound to the specified executor.
typedef basic_overlapped_handle<Executor1> other;
};
/// The native representation of a handle.
#if defined(GENERATING_DOCUMENTATION)
typedef implementation_defined native_handle_type;

View file

@ -44,6 +44,14 @@ public:
/// The type of the executor associated with the object.
typedef Executor executor_type;
/// Rebinds the handle type to another executor.
template <typename Executor1>
struct rebind_executor
{
/// The handle type when rebound to the specified executor.
typedef basic_random_access_handle<Executor1> other;
};
/// The native representation of a handle.
#if defined(GENERATING_DOCUMENTATION)
typedef implementation_defined native_handle_type;
@ -266,26 +274,20 @@ public:
* buffers in one go, and how to use it with arrays, boost::array or
* std::vector.
*/
template <typename ConstBufferSequence, typename WriteHandler>
BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
template <typename ConstBufferSequence,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) WriteHandler
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
void (boost::system::error_code, std::size_t))
async_write_some_at(uint64_t offset,
const ConstBufferSequence& buffers,
BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
BOOST_ASIO_MOVE_ARG(WriteHandler) handler
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
{
// If you get an error on the following line it means that your handler does
// not meet the documented type requirements for a WriteHandler.
BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
boost::asio::async_completion<WriteHandler,
void (boost::system::error_code, std::size_t)> init(handler);
this->impl_.get_service().async_write_some_at(
this->impl_.get_implementation(), offset,
buffers, init.completion_handler,
this->impl_.get_implementation_executor());
return init.result.get();
return async_initiate<WriteHandler,
void (boost::system::error_code, std::size_t)>(
initiate_async_write_some_at(this), handler, offset, buffers);
}
/// Read some data from the handle at the specified offset.
@ -394,27 +396,88 @@ public:
* buffers in one go, and how to use it with arrays, boost::array or
* std::vector.
*/
template <typename MutableBufferSequence, typename ReadHandler>
BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
template <typename MutableBufferSequence,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) ReadHandler
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
void (boost::system::error_code, std::size_t))
async_read_some_at(uint64_t offset,
const MutableBufferSequence& buffers,
BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
BOOST_ASIO_MOVE_ARG(ReadHandler) handler
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
{
// If you get an error on the following line it means that your handler does
// not meet the documented type requirements for a ReadHandler.
BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
boost::asio::async_completion<ReadHandler,
void (boost::system::error_code, std::size_t)> init(handler);
this->impl_.get_service().async_read_some_at(
this->impl_.get_implementation(), offset,
buffers, init.completion_handler,
this->impl_.get_implementation_executor());
return init.result.get();
return async_initiate<ReadHandler,
void (boost::system::error_code, std::size_t)>(
initiate_async_read_some_at(this), handler, offset, buffers);
}
private:
class initiate_async_write_some_at
{
public:
typedef Executor executor_type;
explicit initiate_async_write_some_at(basic_random_access_handle* self)
: self_(self)
{
}
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
{
return self_->get_executor();
}
template <typename WriteHandler, typename ConstBufferSequence>
void operator()(BOOST_ASIO_MOVE_ARG(WriteHandler) handler,
uint64_t offset, const ConstBufferSequence& buffers) const
{
// If you get an error on the following line it means that your handler
// does not meet the documented type requirements for a WriteHandler.
BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
detail::non_const_lvalue<WriteHandler> handler2(handler);
self_->impl_.get_service().async_write_some_at(
self_->impl_.get_implementation(), offset, buffers, handler2.value,
self_->impl_.get_implementation_executor());
}
private:
basic_random_access_handle* self_;
};
class initiate_async_read_some_at
{
public:
typedef Executor executor_type;
explicit initiate_async_read_some_at(basic_random_access_handle* self)
: self_(self)
{
}
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
{
return self_->get_executor();
}
template <typename ReadHandler, typename MutableBufferSequence>
void operator()(BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
uint64_t offset, const MutableBufferSequence& buffers) const
{
// If you get an error on the following line it means that your handler
// does not meet the documented type requirements for a ReadHandler.
BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
detail::non_const_lvalue<ReadHandler> handler2(handler);
self_->impl_.get_service().async_read_some_at(
self_->impl_.get_implementation(), offset, buffers, handler2.value,
self_->impl_.get_implementation_executor());
}
private:
basic_random_access_handle* self_;
};
};
} // namespace windows

View file

@ -47,6 +47,14 @@ public:
/// The type of the executor associated with the object.
typedef Executor executor_type;
/// Rebinds the handle type to another executor.
template <typename Executor1>
struct rebind_executor
{
/// The handle type when rebound to the specified executor.
typedef basic_stream_handle<Executor1> other;
};
/// The native representation of a handle.
#if defined(GENERATING_DOCUMENTATION)
typedef implementation_defined native_handle_type;
@ -259,25 +267,19 @@ public:
* buffers in one go, and how to use it with arrays, boost::array or
* std::vector.
*/
template <typename ConstBufferSequence, typename WriteHandler>
BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
template <typename ConstBufferSequence,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) WriteHandler
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
void (boost::system::error_code, std::size_t))
async_write_some(const ConstBufferSequence& buffers,
BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
BOOST_ASIO_MOVE_ARG(WriteHandler) handler
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
{
// If you get an error on the following line it means that your handler does
// not meet the documented type requirements for a WriteHandler.
BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
boost::asio::async_completion<WriteHandler,
void (boost::system::error_code, std::size_t)> init(handler);
this->impl_.get_service().async_write_some(
this->impl_.get_implementation(),
buffers, init.completion_handler,
this->impl_.get_implementation_executor());
return init.result.get();
return async_initiate<WriteHandler,
void (boost::system::error_code, std::size_t)>(
initiate_async_write_some(this), handler, buffers);
}
/// Read some data from the handle.
@ -379,26 +381,87 @@ public:
* buffers in one go, and how to use it with arrays, boost::array or
* std::vector.
*/
template <typename MutableBufferSequence, typename ReadHandler>
BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
template <typename MutableBufferSequence,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) ReadHandler
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
void (boost::system::error_code, std::size_t))
async_read_some(const MutableBufferSequence& buffers,
BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
BOOST_ASIO_MOVE_ARG(ReadHandler) handler
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
{
// If you get an error on the following line it means that your handler does
// not meet the documented type requirements for a ReadHandler.
BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
boost::asio::async_completion<ReadHandler,
void (boost::system::error_code, std::size_t)> init(handler);
this->impl_.get_service().async_read_some(
this->impl_.get_implementation(),
buffers, init.completion_handler,
this->impl_.get_implementation_executor());
return init.result.get();
return async_initiate<ReadHandler,
void (boost::system::error_code, std::size_t)>(
initiate_async_read_some(this), handler, buffers);
}
private:
class initiate_async_write_some
{
public:
typedef Executor executor_type;
explicit initiate_async_write_some(basic_stream_handle* self)
: self_(self)
{
}
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
{
return self_->get_executor();
}
template <typename WriteHandler, typename ConstBufferSequence>
void operator()(BOOST_ASIO_MOVE_ARG(WriteHandler) handler,
const ConstBufferSequence& buffers) const
{
// If you get an error on the following line it means that your handler
// does not meet the documented type requirements for a WriteHandler.
BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
detail::non_const_lvalue<WriteHandler> handler2(handler);
self_->impl_.get_service().async_write_some(
self_->impl_.get_implementation(), buffers, handler2.value,
self_->impl_.get_implementation_executor());
}
private:
basic_stream_handle* self_;
};
class initiate_async_read_some
{
public:
typedef Executor executor_type;
explicit initiate_async_read_some(basic_stream_handle* self)
: self_(self)
{
}
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
{
return self_->get_executor();
}
template <typename ReadHandler, typename MutableBufferSequence>
void operator()(BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
const MutableBufferSequence& buffers) const
{
// If you get an error on the following line it means that your handler
// does not meet the documented type requirements for a ReadHandler.
BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
detail::non_const_lvalue<ReadHandler> handler2(handler);
self_->impl_.get_service().async_read_some(
self_->impl_.get_implementation(), buffers, handler2.value,
self_->impl_.get_implementation_executor());
}
private:
basic_stream_handle* self_;
};
};
} // namespace windows