MCPcopy Create free account
hub / github.com/boostorg/asio / any_executor_base

Class any_executor_base

include/boost/asio/execution/any_executor.hpp:487–1205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

485};
486
487class any_executor_base
488{
489public:
490 any_executor_base() noexcept
491 : object_fns_(0),
492 target_(0),
493 target_fns_(0)
494 {
495 }
496
497 template <BOOST_ASIO_EXECUTION_EXECUTOR Executor>
498 any_executor_base(Executor ex, false_type)
499 : target_fns_(target_fns_table<Executor>(
500 any_executor_base::query_blocking(ex,
501 can_query<const Executor&, const execution::blocking_t&>())
502 == execution::blocking.always))
503 {
504 any_executor_base::construct_object(ex,
505 integral_constant<bool,
506 sizeof(Executor) <= sizeof(object_type)
507 && alignment_of<Executor>::value <= alignment_of<object_type>::value
508 >());
509 }
510
511 template <BOOST_ASIO_EXECUTION_EXECUTOR Executor>
512 any_executor_base(std::nothrow_t, Executor ex, false_type) noexcept
513 : target_fns_(target_fns_table<Executor>(
514 any_executor_base::query_blocking(ex,
515 can_query<const Executor&, const execution::blocking_t&>())
516 == execution::blocking.always))
517 {
518 any_executor_base::construct_object(std::nothrow, ex,
519 integral_constant<bool,
520 sizeof(Executor) <= sizeof(object_type)
521 && alignment_of<Executor>::value <= alignment_of<object_type>::value
522 >());
523 if (target_ == 0)
524 {
525 object_fns_ = 0;
526 target_fns_ = 0;
527 }
528 }
529
530 template <BOOST_ASIO_EXECUTION_EXECUTOR Executor>
531 any_executor_base(Executor other, true_type)
532 : object_fns_(object_fns_table<shared_target_executor>()),
533 target_fns_(other.target_fns_)
534 {
535 Executor* p = 0;
536 new (&object_) shared_target_executor(
537 static_cast<Executor&&>(other), p);
538 target_ = p->template target<void>();
539 }
540
541 template <BOOST_ASIO_EXECUTION_EXECUTOR Executor>
542 any_executor_base(std::nothrow_t,
543 Executor other, true_type) noexcept
544 : object_fns_(object_fns_table<shared_target_executor>()),

Callers

nothing calls this directly

Calls 3

destroyMethod · 0.45
copyMethod · 0.45
target_typeMethod · 0.45

Tested by

no test coverage detected