/usr/include/boost/asio
NameSizeModeActions
detail/-0755rm
execution/-0755rm
generic/-0755rm
impl/-0755rm
ip/-0755rm
local/-0755rm
posix/-0755rm
ssl/-0755rm
traits/-0755rm
ts/-0755rm
windows/-0755rm
any_io_executor.hpp26250644editdlrm
associated_allocator.hpp37910644editdlrm
associated_executor.hpp50570644editdlrm
async_result.hpp194230644editdlrm
awaitable.hpp32700644editdlrm
basic_datagram_socket.hpp475210644editdlrm
basic_deadline_timer.hpp241580644editdlrm
basic_io_object.hpp80960644editdlrm
basic_raw_socket.hpp469960644editdlrm
basic_seq_packet_socket.hpp291840644editdlrm
basic_serial_port.hpp319120644editdlrm
basic_signal_set.hpp198760644editdlrm
basic_socket.hpp655160644editdlrm
basic_socket_acceptor.hpp880620644editdlrm
basic_socket_iostream.hpp132980644editdlrm
basic_socket_streambuf.hpp217130644editdlrm
basic_streambuf.hpp137140644editdlrm
basic_streambuf_fwd.hpp9200644editdlrm
basic_stream_socket.hpp415200644editdlrm
basic_waitable_timer.hpp285280644editdlrm
bind_executor.hpp165100644editdlrm
buffer.hpp832540644editdlrm
buffered_read_stream.hpp84240644editdlrm
buffered_read_stream_fwd.hpp6990644editdlrm
buffered_stream.hpp90740644editdlrm
buffered_stream_fwd.hpp6690644editdlrm
buffered_write_stream.hpp80420644editdlrm
buffered_write_stream_fwd.hpp7050644editdlrm
buffers_iterator.hpp140490644editdlrm
completion_condition.hpp55000644editdlrm
compose.hpp45960644editdlrm
connect.hpp431570644editdlrm
coroutine.hpp98970644editdlrm
co_spawn.hpp145090644editdlrm
deadline_timer.hpp11380644editdlrm
defer.hpp50700644editdlrm
detached.hpp35170644editdlrm
dispatch.hpp45370644editdlrm
error.hpp103510644editdlrm
execution.hpp18710644editdlrm
execution_context.hpp143410644editdlrm
executor.hpp104670644editdlrm
executor_work_guard.hpp80390644editdlrm
handler_alloc_hook.hpp34710644editdlrm
handler_continuation_hook.hpp14740644editdlrm
handler_invoke_hook.hpp37440644editdlrm
high_resolution_timer.hpp13940644editdlrm
io_context.hpp552260644editdlrm
io_context_strand.hpp137060644editdlrm
io_service.hpp8610644editdlrm
io_service_strand.hpp5750644editdlrm
is_applicable_property.hpp16050644editdlrm
is_executor.hpp13060644editdlrm
is_read_buffered.hpp16460644editdlrm
is_write_buffered.hpp16670644editdlrm
multiple_exceptions.hpp16310644editdlrm
packaged_task.hpp33580644editdlrm
placeholders.hpp41460644editdlrm
post.hpp47600644editdlrm
prefer.hpp188210644editdlrm
query.hpp83230644editdlrm
read.hpp538940644editdlrm
read_at.hpp277660644editdlrm
read_until.hpp1194770644editdlrm
redirect_error.hpp19380644editdlrm
require.hpp149260644editdlrm
require_concept.hpp92180644editdlrm
serial_port.hpp10100644editdlrm
serial_port_base.hpp49750644editdlrm
signal_set.hpp7480644editdlrm
socket_base.hpp159390644editdlrm
spawn.hpp117930644editdlrm
ssl.hpp8480644editdlrm
static_thread_pool.hpp8260644editdlrm
steady_timer.hpp13060644editdlrm
strand.hpp171930644editdlrm
streambuf.hpp8260644editdlrm
system_context.hpp26490644editdlrm
system_executor.hpp225290644editdlrm
system_timer.hpp13060644editdlrm
this_coro.hpp11490644editdlrm
thread_pool.hpp375670644editdlrm
time_traits.hpp22810644editdlrm
unyield.hpp3810644editdlrm
uses_executor.hpp23480644editdlrm
use_awaitable.hpp58210644editdlrm
use_future.hpp48200644editdlrm
version.hpp6860644editdlrm
wait_traits.hpp14510644editdlrm
write.hpp529590644editdlrm
write_at.hpp295140644editdlrm
yield.hpp4820644editdlrm
Edit: /usr/include/boost/asio/system_executor.hpp (22529B)
// // system_executor.hpp // ~~~~~~~~~~~~~~~~~~~ // // Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #ifndef BOOST_ASIO_SYSTEM_EXECUTOR_HPP #define BOOST_ASIO_SYSTEM_EXECUTOR_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include #include #include #include namespace boost { namespace asio { class system_context; /// An executor that uses arbitrary threads. /** * The system executor represents an execution context where functions are * permitted to run on arbitrary threads. When the blocking.never property is * established, the system executor will schedule the function to run on an * unspecified system thread pool. When either blocking.possibly or * blocking.always is established, the executor invokes the function * immediately. */ template class basic_system_executor { public: /// Default constructor. basic_system_executor() BOOST_ASIO_NOEXCEPT : allocator_(Allocator()) { } /// Obtain an executor with the @c blocking.possibly property. /** * Do not call this function directly. It is intended for use with the * boost::asio::require customisation point. * * For example: * @code boost::asio::system_executor ex1; * auto ex2 = boost::asio::require(ex1, * boost::asio::execution::blocking.possibly); @endcode */ basic_system_executor require(execution::blocking_t::possibly_t) const { return basic_system_executor(allocator_); } /// Obtain an executor with the @c blocking.always property. /** * Do not call this function directly. It is intended for use with the * boost::asio::require customisation point. * * For example: * @code boost::asio::system_executor ex1; * auto ex2 = boost::asio::require(ex1, * boost::asio::execution::blocking.always); @endcode */ basic_system_executor require(execution::blocking_t::always_t) const { return basic_system_executor(allocator_); } /// Obtain an executor with the @c blocking.never property. /** * Do not call this function directly. It is intended for use with the * boost::asio::require customisation point. * * For example: * @code boost::asio::system_executor ex1; * auto ex2 = boost::asio::require(ex1, * boost::asio::execution::blocking.never); @endcode */ basic_system_executor require(execution::blocking_t::never_t) const { return basic_system_executor(allocator_); } /// Obtain an executor with the @c relationship.continuation property. /** * Do not call this function directly. It is intended for use with the * boost::asio::require customisation point. * * For example: * @code boost::asio::system_executor ex1; * auto ex2 = boost::asio::require(ex1, * boost::asio::execution::relationship.continuation); @endcode */ basic_system_executor require(execution::relationship_t::continuation_t) const { return basic_system_executor(allocator_); } /// Obtain an executor with the @c relationship.fork property. /** * Do not call this function directly. It is intended for use with the * boost::asio::require customisation point. * * For example: * @code boost::asio::system_executor ex1; * auto ex2 = boost::asio::require(ex1, * boost::asio::execution::relationship.fork); @endcode */ basic_system_executor require(execution::relationship_t::fork_t) const { return basic_system_executor(allocator_); } /// Obtain an executor with the specified @c allocator property. /** * Do not call this function directly. It is intended for use with the * boost::asio::require customisation point. * * For example: * @code boost::asio::system_executor ex1; * auto ex2 = boost::asio::require(ex1, * boost::asio::execution::allocator(my_allocator)); @endcode */ template basic_system_executor require(execution::allocator_t a) const { return basic_system_executor(a.value()); } /// Obtain an executor with the default @c allocator property. /** * Do not call this function directly. It is intended for use with the * boost::asio::require customisation point. * * For example: * @code boost::asio::system_executor ex1; * auto ex2 = boost::asio::require(ex1, * boost::asio::execution::allocator); @endcode */ basic_system_executor > require(execution::allocator_t) const { return basic_system_executor >(); } /// Query the current value of the @c mapping property. /** * Do not call this function directly. It is intended for use with the * boost::asio::query customisation point. * * For example: * @code boost::asio::system_executor ex; * if (boost::asio::query(ex, boost::asio::execution::mapping) * == boost::asio::execution::mapping.thread) * ... @endcode */ static BOOST_ASIO_CONSTEXPR execution::mapping_t query( execution::mapping_t) BOOST_ASIO_NOEXCEPT { return execution::mapping.thread; } /// Query the current value of the @c context property. /** * Do not call this function directly. It is intended for use with the * boost::asio::query customisation point. * * For example: * @code boost::asio::system_executor ex; * boost::asio::system_context& pool = boost::asio::query( * ex, boost::asio::execution::context); @endcode */ static system_context& query(execution::context_t) BOOST_ASIO_NOEXCEPT; /// Query the current value of the @c blocking property. /** * Do not call this function directly. It is intended for use with the * boost::asio::query customisation point. * * For example: * @code boost::asio::system_executor ex; * if (boost::asio::query(ex, boost::asio::execution::blocking) * == boost::asio::execution::blocking.always) * ... @endcode */ static BOOST_ASIO_CONSTEXPR execution::blocking_t query( execution::blocking_t) BOOST_ASIO_NOEXCEPT { return Blocking(); } /// Query the current value of the @c relationship property. /** * Do not call this function directly. It is intended for use with the * boost::asio::query customisation point. * * For example: * @code boost::asio::system_executor ex; * if (boost::asio::query(ex, boost::asio::execution::relationship) * == boost::asio::execution::relationship.continuation) * ... @endcode */ static BOOST_ASIO_CONSTEXPR execution::relationship_t query( execution::relationship_t) BOOST_ASIO_NOEXCEPT { return Relationship(); } /// Query the current value of the @c allocator property. /** * Do not call this function directly. It is intended for use with the * boost::asio::query customisation point. * * For example: * @code boost::asio::system_executor ex; * auto alloc = boost::asio::query(ex, * boost::asio::execution::allocator); @endcode */ template BOOST_ASIO_CONSTEXPR Allocator query( execution::allocator_t) const BOOST_ASIO_NOEXCEPT { return allocator_; } /// Query the current value of the @c allocator property. /** * Do not call this function directly. It is intended for use with the * boost::asio::query customisation point. * * For example: * @code boost::asio::system_executor ex; * auto alloc = boost::asio::query(ex, * boost::asio::execution::allocator); @endcode */ BOOST_ASIO_CONSTEXPR Allocator query( execution::allocator_t) const BOOST_ASIO_NOEXCEPT { return allocator_; } /// Query the occupancy (recommended number of work items) for the system /// context. /** * Do not call this function directly. It is intended for use with the * boost::asio::query customisation point. * * For example: * @code boost::asio::system_executor ex; * std::size_t occupancy = boost::asio::query( * ex, boost::asio::execution::occupancy); @endcode */ std::size_t query(execution::occupancy_t) const BOOST_ASIO_NOEXCEPT; /// Compare two executors for equality. /** * Two executors are equal if they refer to the same underlying io_context. */ friend bool operator==(const basic_system_executor&, const basic_system_executor&) BOOST_ASIO_NOEXCEPT { return true; } /// Compare two executors for inequality. /** * Two executors are equal if they refer to the same underlying io_context. */ friend bool operator!=(const basic_system_executor&, const basic_system_executor&) BOOST_ASIO_NOEXCEPT { return false; } /// Execution function. /** * Do not call this function directly. It is intended for use with the * execution::execute customisation point. * * For example: * @code boost::asio::system_executor ex; * execution::execute(ex, my_function_object); @endcode */ template void execute(BOOST_ASIO_MOVE_ARG(Function) f) const { this->do_execute(BOOST_ASIO_MOVE_CAST(Function)(f), Blocking()); } #if !defined(BOOST_ASIO_NO_TS_EXECUTORS) /// Obtain the underlying execution context. system_context& context() const BOOST_ASIO_NOEXCEPT; /// Inform the executor that it has some outstanding work to do. /** * For the system executor, this is a no-op. */ void on_work_started() const BOOST_ASIO_NOEXCEPT { } /// Inform the executor that some work is no longer outstanding. /** * For the system executor, this is a no-op. */ void on_work_finished() const BOOST_ASIO_NOEXCEPT { } /// Request the system executor to invoke the given function object. /** * This function is used to ask the executor to execute the given function * object. The function object will always be executed inside this function. * * @param f The function object to be called. The executor will make * a copy of the handler object as required. The function signature of the * function object must be: @code void function(); @endcode * * @param a An allocator that may be used by the executor to allocate the * internal storage needed for function invocation. */ template void dispatch(BOOST_ASIO_MOVE_ARG(Function) f, const OtherAllocator& a) const; /// Request the system executor to invoke the given function object. /** * This function is used to ask the executor to execute the given function * object. The function object will never be executed inside this function. * Instead, it will be scheduled to run on an unspecified system thread pool. * * @param f The function object to be called. The executor will make * a copy of the handler object as required. The function signature of the * function object must be: @code void function(); @endcode * * @param a An allocator that may be used by the executor to allocate the * internal storage needed for function invocation. */ template void post(BOOST_ASIO_MOVE_ARG(Function) f, const OtherAllocator& a) const; /// Request the system executor to invoke the given function object. /** * This function is used to ask the executor to execute the given function * object. The function object will never be executed inside this function. * Instead, it will be scheduled to run on an unspecified system thread pool. * * @param f The function object to be called. The executor will make * a copy of the handler object as required. The function signature of the * function object must be: @code void function(); @endcode * * @param a An allocator that may be used by the executor to allocate the * internal storage needed for function invocation. */ template void defer(BOOST_ASIO_MOVE_ARG(Function) f, const OtherAllocator& a) const; #endif // !defined(BOOST_ASIO_NO_TS_EXECUTORS) private: template friend class basic_system_executor; // Constructor used by require(). basic_system_executor(const Allocator& a) : allocator_(a) { } /// Execution helper implementation for the possibly blocking property. template void do_execute(BOOST_ASIO_MOVE_ARG(Function) f, execution::blocking_t::possibly_t) const; /// Execution helper implementation for the always blocking property. template void do_execute(BOOST_ASIO_MOVE_ARG(Function) f, execution::blocking_t::always_t) const; /// Execution helper implementation for the never blocking property. template void do_execute(BOOST_ASIO_MOVE_ARG(Function) f, execution::blocking_t::never_t) const; // The allocator used for execution functions. Allocator allocator_; }; /// An executor that uses arbitrary threads. /** * The system executor represents an execution context where functions are * permitted to run on arbitrary threads. When the blocking.never property is * established, the system executor will schedule the function to run on an * unspecified system thread pool. When either blocking.possibly or * blocking.always is established, the executor invokes the function * immediately. */ typedef basic_system_executor > system_executor; #if !defined(GENERATING_DOCUMENTATION) namespace traits { #if !defined(BOOST_ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT) template struct equality_comparable< boost::asio::basic_system_executor > { BOOST_ASIO_STATIC_CONSTEXPR(bool, is_valid = true); BOOST_ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); }; #endif // !defined(BOOST_ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT) #if !defined(BOOST_ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT) template struct execute_member< boost::asio::basic_system_executor, Function > { BOOST_ASIO_STATIC_CONSTEXPR(bool, is_valid = true); BOOST_ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false); typedef void result_type; }; #endif // !defined(BOOST_ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT) #if !defined(BOOST_ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT) template struct require_member< boost::asio::basic_system_executor, boost::asio::execution::blocking_t::possibly_t > { BOOST_ASIO_STATIC_CONSTEXPR(bool, is_valid = true); BOOST_ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false); typedef boost::asio::basic_system_executor< boost::asio::execution::blocking_t::possibly_t, Relationship, Allocator> result_type; }; template struct require_member< boost::asio::basic_system_executor, boost::asio::execution::blocking_t::always_t > { BOOST_ASIO_STATIC_CONSTEXPR(bool, is_valid = true); BOOST_ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false); typedef boost::asio::basic_system_executor< boost::asio::execution::blocking_t::always_t, Relationship, Allocator> result_type; }; template struct require_member< boost::asio::basic_system_executor, boost::asio::execution::blocking_t::never_t > { BOOST_ASIO_STATIC_CONSTEXPR(bool, is_valid = true); BOOST_ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false); typedef boost::asio::basic_system_executor< boost::asio::execution::blocking_t::never_t, Relationship, Allocator> result_type; }; template struct require_member< boost::asio::basic_system_executor, boost::asio::execution::relationship_t::fork_t > { BOOST_ASIO_STATIC_CONSTEXPR(bool, is_valid = true); BOOST_ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false); typedef boost::asio::basic_system_executor result_type; }; template struct require_member< boost::asio::basic_system_executor, boost::asio::execution::relationship_t::continuation_t > { BOOST_ASIO_STATIC_CONSTEXPR(bool, is_valid = true); BOOST_ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false); typedef boost::asio::basic_system_executor result_type; }; template struct require_member< boost::asio::basic_system_executor, boost::asio::execution::allocator_t > { BOOST_ASIO_STATIC_CONSTEXPR(bool, is_valid = true); BOOST_ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false); typedef boost::asio::basic_system_executor > result_type; }; template struct require_member< boost::asio::basic_system_executor, boost::asio::execution::allocator_t > { BOOST_ASIO_STATIC_CONSTEXPR(bool, is_valid = true); BOOST_ASIO_STATIC_CONSTEXPR(bool, is_noexcept = false); typedef boost::asio::basic_system_executor result_type; }; #endif // !defined(BOOST_ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT) #if !defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) template struct query_static_constexpr_member< boost::asio::basic_system_executor, Property, typename boost::asio::enable_if< boost::asio::is_convertible< Property, boost::asio::execution::mapping_t >::value >::type > { BOOST_ASIO_STATIC_CONSTEXPR(bool, is_valid = true); BOOST_ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); typedef boost::asio::execution::mapping_t::thread_t result_type; static BOOST_ASIO_CONSTEXPR result_type value() BOOST_ASIO_NOEXCEPT { return result_type(); } }; #endif // !defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT) #if !defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) template struct query_member< boost::asio::basic_system_executor, Property, typename boost::asio::enable_if< boost::asio::is_convertible< Property, boost::asio::execution::blocking_t >::value >::type > { BOOST_ASIO_STATIC_CONSTEXPR(bool, is_valid = true); BOOST_ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); typedef boost::asio::execution::blocking_t result_type; }; template struct query_member< boost::asio::basic_system_executor, Property, typename boost::asio::enable_if< boost::asio::is_convertible< Property, boost::asio::execution::relationship_t >::value >::type > { BOOST_ASIO_STATIC_CONSTEXPR(bool, is_valid = true); BOOST_ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); typedef boost::asio::execution::relationship_t result_type; }; template struct query_member< boost::asio::basic_system_executor, boost::asio::execution::context_t > { BOOST_ASIO_STATIC_CONSTEXPR(bool, is_valid = true); BOOST_ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); typedef boost::asio::system_context& result_type; }; template struct query_member< boost::asio::basic_system_executor, boost::asio::execution::allocator_t > { BOOST_ASIO_STATIC_CONSTEXPR(bool, is_valid = true); BOOST_ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); typedef Allocator result_type; }; template struct query_member< boost::asio::basic_system_executor, boost::asio::execution::allocator_t > { BOOST_ASIO_STATIC_CONSTEXPR(bool, is_valid = true); BOOST_ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true); typedef Allocator result_type; }; #endif // !defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) } // namespace traits #endif // !defined(GENERATING_DOCUMENTATION) } // namespace asio } // namespace boost #include #include #endif // BOOST_ASIO_SYSTEM_EXECUTOR_HPP