include/boost/capy/ex/executor_ref.hpp

100.0% Lines (46 / 46) 42.2% Functions (78 / 185)
executor_ref.hpp
f(x) Functions (185)
Function Calls Lines Blocks
boost::capy::detail::vtable_for<boost::capy::(anonymous namespace)::counting_executor>::{lambda(void const*)#1}::operator()(void const*) const :45 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::(anonymous namespace)::local_executor<0> >::{lambda(void const*)#1}::operator()(void const*) const :45 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::(anonymous namespace)::reentrant_executor>::{lambda(void const*)#1}::operator()(void const*) const :45 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::(anonymous namespace)::worker_executor>::{lambda(void const*)#1}::operator()(void const*) const :45 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::any_executor>::{lambda(void const*)#1}::operator()(void const*) const :45 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::closing_executor>::{lambda(void const*)#1}::operator()(void const*) const :45 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::queue_executor>::{lambda(void const*)#1}::operator()(void const*) const :45 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::queuing_executor>::{lambda(void const*)#1}::operator()(void const*) const :45 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::refusing_executor>::{lambda(void const*)#1}::operator()(void const*) const :45 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::run_test::counting_queue_executor>::{lambda(void const*)#1}::operator()(void const*) const :45 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::run_test::testCallerUnwoundInlineWithValueAllocator()::closing_executor>::{lambda(void const*)#1}::operator()(void const*) const :45 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::run_test::throwing_post_executor>::{lambda(void const*)#1}::operator()(void const*) const :45 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::strand<boost::capy::executor_ref> >::{lambda(void const*)#1}::operator()(void const*) const :45 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::strand<boost::capy::queuing_executor> >::{lambda(void const*)#1}::operator()(void const*) const :45 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::strand<boost::capy::test::priority_executor<boost::capy::queuing_executor> > >::{lambda(void const*)#1}::operator()(void const*) const :45 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::strand<boost::capy::thread_pool::executor_type> >::{lambda(void const*)#1}::operator()(void const*) const :45 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::strand_test::testFirstPostRacesShutdown()::locked_executor>::{lambda(void const*)#1}::operator()(void const*) const :45 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::strand_test::testInnerPostThrows()::throwing_executor>::{lambda(void const*)#1}::operator()(void const*) const :45 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::sync_executor>::{lambda(void const*)#1}::operator()(void const*) const :45 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::test::blocking_executor>::{lambda(void const*)#1}::operator()(void const*) const :45 1x 50.0% 100.0% boost::capy::detail::vtable_for<boost::capy::test::priority_executor<boost::capy::queuing_executor> >::{lambda(void const*)#1}::operator()(void const*) const :45 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::test_executor>::{lambda(void const*)#1}::operator()(void const*) const :45 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::thread_pool::executor_type>::{lambda(void const*)#1}::operator()(void const*) const :45 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::tracking_executor>::{lambda(void const*)#1}::operator()(void const*) const :45 0 0.0% 0.0% boost::capy::detail::vtable_for<trace_loop::executor_type>::{lambda(void const*)#1}::operator()(void const*) const :45 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::(anonymous namespace)::counting_executor>::{lambda(void const*)#2}::operator()(void const*) const :49 1x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::(anonymous namespace)::local_executor<0> >::{lambda(void const*)#2}::operator()(void const*) const :49 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::(anonymous namespace)::reentrant_executor>::{lambda(void const*)#2}::operator()(void const*) const :49 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::(anonymous namespace)::worker_executor>::{lambda(void const*)#2}::operator()(void const*) const :49 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::any_executor>::{lambda(void const*)#2}::operator()(void const*) const :49 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::closing_executor>::{lambda(void const*)#2}::operator()(void const*) const :49 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::queue_executor>::{lambda(void const*)#2}::operator()(void const*) const :49 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::queuing_executor>::{lambda(void const*)#2}::operator()(void const*) const :49 5x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::refusing_executor>::{lambda(void const*)#2}::operator()(void const*) const :49 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::run_test::counting_queue_executor>::{lambda(void const*)#2}::operator()(void const*) const :49 6x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::run_test::testCallerUnwoundInlineWithValueAllocator()::closing_executor>::{lambda(void const*)#2}::operator()(void const*) const :49 1x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::run_test::throwing_post_executor>::{lambda(void const*)#2}::operator()(void const*) const :49 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::strand<boost::capy::executor_ref> >::{lambda(void const*)#2}::operator()(void const*) const :49 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::strand<boost::capy::queuing_executor> >::{lambda(void const*)#2}::operator()(void const*) const :49 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::strand<boost::capy::test::priority_executor<boost::capy::queuing_executor> > >::{lambda(void const*)#2}::operator()(void const*) const :49 1x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::strand<boost::capy::thread_pool::executor_type> >::{lambda(void const*)#2}::operator()(void const*) const :49 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::strand_test::testFirstPostRacesShutdown()::locked_executor>::{lambda(void const*)#2}::operator()(void const*) const :49 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::strand_test::testInnerPostThrows()::throwing_executor>::{lambda(void const*)#2}::operator()(void const*) const :49 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::sync_executor>::{lambda(void const*)#2}::operator()(void const*) const :49 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::test::blocking_executor>::{lambda(void const*)#2}::operator()(void const*) const :49 2x 50.0% 100.0% boost::capy::detail::vtable_for<boost::capy::test::priority_executor<boost::capy::queuing_executor> >::{lambda(void const*)#2}::operator()(void const*) const :49 2x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::test_executor>::{lambda(void const*)#2}::operator()(void const*) const :49 12x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::thread_pool::executor_type>::{lambda(void const*)#2}::operator()(void const*) const :49 58x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::tracking_executor>::{lambda(void const*)#2}::operator()(void const*) const :49 0 0.0% 0.0% boost::capy::detail::vtable_for<trace_loop::executor_type>::{lambda(void const*)#2}::operator()(void const*) const :49 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::(anonymous namespace)::counting_executor>::{lambda(void const*)#3}::operator()(void const*) const :53 1x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::(anonymous namespace)::local_executor<0> >::{lambda(void const*)#3}::operator()(void const*) const :53 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::(anonymous namespace)::reentrant_executor>::{lambda(void const*)#3}::operator()(void const*) const :53 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::(anonymous namespace)::worker_executor>::{lambda(void const*)#3}::operator()(void const*) const :53 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::any_executor>::{lambda(void const*)#3}::operator()(void const*) const :53 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::closing_executor>::{lambda(void const*)#3}::operator()(void const*) const :53 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::queue_executor>::{lambda(void const*)#3}::operator()(void const*) const :53 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::queuing_executor>::{lambda(void const*)#3}::operator()(void const*) const :53 5x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::refusing_executor>::{lambda(void const*)#3}::operator()(void const*) const :53 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::run_test::counting_queue_executor>::{lambda(void const*)#3}::operator()(void const*) const :53 6x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::run_test::testCallerUnwoundInlineWithValueAllocator()::closing_executor>::{lambda(void const*)#3}::operator()(void const*) const :53 1x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::run_test::throwing_post_executor>::{lambda(void const*)#3}::operator()(void const*) const :53 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::strand<boost::capy::executor_ref> >::{lambda(void const*)#3}::operator()(void const*) const :53 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::strand<boost::capy::queuing_executor> >::{lambda(void const*)#3}::operator()(void const*) const :53 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::strand<boost::capy::test::priority_executor<boost::capy::queuing_executor> > >::{lambda(void const*)#3}::operator()(void const*) const :53 1x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::strand<boost::capy::thread_pool::executor_type> >::{lambda(void const*)#3}::operator()(void const*) const :53 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::strand_test::testFirstPostRacesShutdown()::locked_executor>::{lambda(void const*)#3}::operator()(void const*) const :53 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::strand_test::testInnerPostThrows()::throwing_executor>::{lambda(void const*)#3}::operator()(void const*) const :53 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::sync_executor>::{lambda(void const*)#3}::operator()(void const*) const :53 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::test::blocking_executor>::{lambda(void const*)#3}::operator()(void const*) const :53 2x 50.0% 100.0% boost::capy::detail::vtable_for<boost::capy::test::priority_executor<boost::capy::queuing_executor> >::{lambda(void const*)#3}::operator()(void const*) const :53 2x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::test_executor>::{lambda(void const*)#3}::operator()(void const*) const :53 12x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::thread_pool::executor_type>::{lambda(void const*)#3}::operator()(void const*) const :53 58x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::tracking_executor>::{lambda(void const*)#3}::operator()(void const*) const :53 0 0.0% 0.0% boost::capy::detail::vtable_for<trace_loop::executor_type>::{lambda(void const*)#3}::operator()(void const*) const :53 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::(anonymous namespace)::counting_executor>::{lambda(void const*, boost::capy::continuation&)#1}::operator()(void const*, boost::capy::continuation&) const :57 1x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::(anonymous namespace)::local_executor<0> >::{lambda(void const*, boost::capy::continuation&)#1}::operator()(void const*, boost::capy::continuation&) const :57 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::(anonymous namespace)::reentrant_executor>::{lambda(void const*, boost::capy::continuation&)#1}::operator()(void const*, boost::capy::continuation&) const :57 7x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::(anonymous namespace)::worker_executor>::{lambda(void const*, boost::capy::continuation&)#1}::operator()(void const*, boost::capy::continuation&) const :57 300x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::any_executor>::{lambda(void const*, boost::capy::continuation&)#1}::operator()(void const*, boost::capy::continuation&) const :57 2x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::closing_executor>::{lambda(void const*, boost::capy::continuation&)#1}::operator()(void const*, boost::capy::continuation&) const :57 27x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::queue_executor>::{lambda(void const*, boost::capy::continuation&)#1}::operator()(void const*, boost::capy::continuation&) const :57 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::queuing_executor>::{lambda(void const*, boost::capy::continuation&)#1}::operator()(void const*, boost::capy::continuation&) const :57 1187x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::refusing_executor>::{lambda(void const*, boost::capy::continuation&)#1}::operator()(void const*, boost::capy::continuation&) const :57 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::run_test::counting_queue_executor>::{lambda(void const*, boost::capy::continuation&)#1}::operator()(void const*, boost::capy::continuation&) const :57 6x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::run_test::testCallerUnwoundInlineWithValueAllocator()::closing_executor>::{lambda(void const*, boost::capy::continuation&)#1}::operator()(void const*, boost::capy::continuation&) const :57 1x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::run_test::throwing_post_executor>::{lambda(void const*, boost::capy::continuation&)#1}::operator()(void const*, boost::capy::continuation&) const :57 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::strand<boost::capy::executor_ref> >::{lambda(void const*, boost::capy::continuation&)#1}::operator()(void const*, boost::capy::continuation&) const :57 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::strand<boost::capy::queuing_executor> >::{lambda(void const*, boost::capy::continuation&)#1}::operator()(void const*, boost::capy::continuation&) const :57 200007x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::strand<boost::capy::test::priority_executor<boost::capy::queuing_executor> > >::{lambda(void const*, boost::capy::continuation&)#1}::operator()(void const*, boost::capy::continuation&) const :57 1x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::strand<boost::capy::thread_pool::executor_type> >::{lambda(void const*, boost::capy::continuation&)#1}::operator()(void const*, boost::capy::continuation&) const :57 6x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::strand_test::testFirstPostRacesShutdown()::locked_executor>::{lambda(void const*, boost::capy::continuation&)#1}::operator()(void const*, boost::capy::continuation&) const :57 676x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::strand_test::testInnerPostThrows()::throwing_executor>::{lambda(void const*, boost::capy::continuation&)#1}::operator()(void const*, boost::capy::continuation&) const :57 2x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::sync_executor>::{lambda(void const*, boost::capy::continuation&)#1}::operator()(void const*, boost::capy::continuation&) const :57 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::test::blocking_executor>::{lambda(void const*, boost::capy::continuation&)#1}::operator()(void const*, boost::capy::continuation&) const :57 191x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::test::priority_executor<boost::capy::queuing_executor> >::{lambda(void const*, boost::capy::continuation&)#1}::operator()(void const*, boost::capy::continuation&) const :57 4x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::test_executor>::{lambda(void const*, boost::capy::continuation&)#1}::operator()(void const*, boost::capy::continuation&) const :57 378x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::thread_pool::executor_type>::{lambda(void const*, boost::capy::continuation&)#1}::operator()(void const*, boost::capy::continuation&) const :57 20760x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::tracking_executor>::{lambda(void const*, boost::capy::continuation&)#1}::operator()(void const*, boost::capy::continuation&) const :57 0 0.0% 0.0% boost::capy::detail::vtable_for<trace_loop::executor_type>::{lambda(void const*, boost::capy::continuation&)#1}::operator()(void const*, boost::capy::continuation&) const :57 1x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::(anonymous namespace)::counting_executor>::{lambda(void const*, boost::capy::continuation&)#2}::operator()(void const*, boost::capy::continuation&) const :61 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::(anonymous namespace)::local_executor<0> >::{lambda(void const*, boost::capy::continuation&)#2}::operator()(void const*, boost::capy::continuation&) const :61 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::(anonymous namespace)::reentrant_executor>::{lambda(void const*, boost::capy::continuation&)#2}::operator()(void const*, boost::capy::continuation&) const :61 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::(anonymous namespace)::worker_executor>::{lambda(void const*, boost::capy::continuation&)#2}::operator()(void const*, boost::capy::continuation&) const :61 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::any_executor>::{lambda(void const*, boost::capy::continuation&)#2}::operator()(void const*, boost::capy::continuation&) const :61 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::closing_executor>::{lambda(void const*, boost::capy::continuation&)#2}::operator()(void const*, boost::capy::continuation&) const :61 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::queue_executor>::{lambda(void const*, boost::capy::continuation&)#2}::operator()(void const*, boost::capy::continuation&) const :61 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::queuing_executor>::{lambda(void const*, boost::capy::continuation&)#2}::operator()(void const*, boost::capy::continuation&) const :61 1x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::refusing_executor>::{lambda(void const*, boost::capy::continuation&)#2}::operator()(void const*, boost::capy::continuation&) const :61 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::run_test::counting_queue_executor>::{lambda(void const*, boost::capy::continuation&)#2}::operator()(void const*, boost::capy::continuation&) const :61 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::run_test::testCallerUnwoundInlineWithValueAllocator()::closing_executor>::{lambda(void const*, boost::capy::continuation&)#2}::operator()(void const*, boost::capy::continuation&) const :61 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::run_test::throwing_post_executor>::{lambda(void const*, boost::capy::continuation&)#2}::operator()(void const*, boost::capy::continuation&) const :61 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::strand<boost::capy::executor_ref> >::{lambda(void const*, boost::capy::continuation&)#2}::operator()(void const*, boost::capy::continuation&) const :61 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::strand<boost::capy::queuing_executor> >::{lambda(void const*, boost::capy::continuation&)#2}::operator()(void const*, boost::capy::continuation&) const :61 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::strand<boost::capy::test::priority_executor<boost::capy::queuing_executor> > >::{lambda(void const*, boost::capy::continuation&)#2}::operator()(void const*, boost::capy::continuation&) const :61 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::strand<boost::capy::thread_pool::executor_type> >::{lambda(void const*, boost::capy::continuation&)#2}::operator()(void const*, boost::capy::continuation&) const :61 3x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::strand_test::testFirstPostRacesShutdown()::locked_executor>::{lambda(void const*, boost::capy::continuation&)#2}::operator()(void const*, boost::capy::continuation&) const :61 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::strand_test::testInnerPostThrows()::throwing_executor>::{lambda(void const*, boost::capy::continuation&)#2}::operator()(void const*, boost::capy::continuation&) const :61 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::sync_executor>::{lambda(void const*, boost::capy::continuation&)#2}::operator()(void const*, boost::capy::continuation&) const :61 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::test::blocking_executor>::{lambda(void const*, boost::capy::continuation&)#2}::operator()(void const*, boost::capy::continuation&) const :61 61x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::test::priority_executor<boost::capy::queuing_executor> >::{lambda(void const*, boost::capy::continuation&)#2}::operator()(void const*, boost::capy::continuation&) const :61 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::test_executor>::{lambda(void const*, boost::capy::continuation&)#2}::operator()(void const*, boost::capy::continuation&) const :61 73x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::thread_pool::executor_type>::{lambda(void const*, boost::capy::continuation&)#2}::operator()(void const*, boost::capy::continuation&) const :61 4x 100.0% 100.0% boost::capy::detail::vtable_for<boost::capy::tracking_executor>::{lambda(void const*, boost::capy::continuation&)#2}::operator()(void const*, boost::capy::continuation&) const :61 0 0.0% 0.0% boost::capy::detail::vtable_for<trace_loop::executor_type>::{lambda(void const*, boost::capy::continuation&)#2}::operator()(void const*, boost::capy::continuation&) const :61 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::(anonymous namespace)::counting_executor>::{lambda(void const*, void const*)#1}::operator()(void const*, void const*) const :65 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::(anonymous namespace)::local_executor<0> >::{lambda(void const*, void const*)#1}::operator()(void const*, void const*) const :65 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::(anonymous namespace)::reentrant_executor>::{lambda(void const*, void const*)#1}::operator()(void const*, void const*) const :65 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::(anonymous namespace)::worker_executor>::{lambda(void const*, void const*)#1}::operator()(void const*, void const*) const :65 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::any_executor>::{lambda(void const*, void const*)#1}::operator()(void const*, void const*) const :65 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::closing_executor>::{lambda(void const*, void const*)#1}::operator()(void const*, void const*) const :65 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::queue_executor>::{lambda(void const*, void const*)#1}::operator()(void const*, void const*) const :65 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::queuing_executor>::{lambda(void const*, void const*)#1}::operator()(void const*, void const*) const :65 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::refusing_executor>::{lambda(void const*, void const*)#1}::operator()(void const*, void const*) const :65 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::run_test::counting_queue_executor>::{lambda(void const*, void const*)#1}::operator()(void const*, void const*) const :65 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::run_test::testCallerUnwoundInlineWithValueAllocator()::closing_executor>::{lambda(void const*, void const*)#1}::operator()(void const*, void const*) const :65 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::run_test::throwing_post_executor>::{lambda(void const*, void const*)#1}::operator()(void const*, void const*) const :65 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::strand<boost::capy::executor_ref> >::{lambda(void const*, void const*)#1}::operator()(void const*, void const*) const :65 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::strand<boost::capy::queuing_executor> >::{lambda(void const*, void const*)#1}::operator()(void const*, void const*) const :65 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::strand<boost::capy::test::priority_executor<boost::capy::queuing_executor> > >::{lambda(void const*, void const*)#1}::operator()(void const*, void const*) const :65 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::strand<boost::capy::thread_pool::executor_type> >::{lambda(void const*, void const*)#1}::operator()(void const*, void const*) const :65 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::strand_test::testFirstPostRacesShutdown()::locked_executor>::{lambda(void const*, void const*)#1}::operator()(void const*, void const*) const :65 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::strand_test::testInnerPostThrows()::throwing_executor>::{lambda(void const*, void const*)#1}::operator()(void const*, void const*) const :65 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::sync_executor>::{lambda(void const*, void const*)#1}::operator()(void const*, void const*) const :65 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::test::blocking_executor>::{lambda(void const*, void const*)#1}::operator()(void const*, void const*) const :65 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::test::priority_executor<boost::capy::queuing_executor> >::{lambda(void const*, void const*)#1}::operator()(void const*, void const*) const :65 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::test_executor>::{lambda(void const*, void const*)#1}::operator()(void const*, void const*) const :65 0 0.0% 0.0% boost::capy::detail::vtable_for<boost::capy::thread_pool::executor_type>::{lambda(void const*, void const*)#1}::operator()(void const*, void const*) const :65 1x 50.0% 100.0% boost::capy::detail::vtable_for<boost::capy::tracking_executor>::{lambda(void const*, void const*)#1}::operator()(void const*, void const*) const :65 0 0.0% 0.0% boost::capy::detail::vtable_for<trace_loop::executor_type>::{lambda(void const*, void const*)#1}::operator()(void const*, void const*) const :65 0 0.0% 0.0% boost::capy::executor_ref::executor_ref() :117 317774x 100.0% 100.0% boost::capy::executor_ref::executor_ref<boost::capy::(anonymous namespace)::counting_executor, 0>(boost::capy::(anonymous namespace)::counting_executor const&) :158 2x 100.0% 100.0% boost::capy::executor_ref::executor_ref<boost::capy::(anonymous namespace)::local_executor<0>, 0>(boost::capy::(anonymous namespace)::local_executor<0> const&) :158 1x 100.0% 100.0% boost::capy::executor_ref::executor_ref<boost::capy::(anonymous namespace)::reentrant_executor, 0>(boost::capy::(anonymous namespace)::reentrant_executor const&) :158 7x 100.0% 100.0% boost::capy::executor_ref::executor_ref<boost::capy::(anonymous namespace)::worker_executor, 0>(boost::capy::(anonymous namespace)::worker_executor const&) :158 600x 100.0% 100.0% boost::capy::executor_ref::executor_ref<boost::capy::any_executor, 0>(boost::capy::any_executor const&) :158 30x 100.0% 100.0% boost::capy::executor_ref::executor_ref<boost::capy::closing_executor, 0>(boost::capy::closing_executor const&) :158 14x 100.0% 100.0% boost::capy::executor_ref::executor_ref<boost::capy::queue_executor, 0>(boost::capy::queue_executor const&) :158 14x 100.0% 100.0% boost::capy::executor_ref::executor_ref<boost::capy::queuing_executor, 0>(boost::capy::queuing_executor const&) :158 302320x 100.0% 100.0% boost::capy::executor_ref::executor_ref<boost::capy::refusing_executor, 0>(boost::capy::refusing_executor const&) :158 2x 100.0% 100.0% boost::capy::executor_ref::executor_ref<boost::capy::run_test::counting_queue_executor, 0>(boost::capy::run_test::counting_queue_executor const&) :158 11x 100.0% 100.0% boost::capy::executor_ref::executor_ref<boost::capy::run_test::testCallerUnwoundInlineWithValueAllocator()::closing_executor, 0>(boost::capy::run_test::testCallerUnwoundInlineWithValueAllocator()::closing_executor const&) :158 2x 100.0% 100.0% boost::capy::executor_ref::executor_ref<boost::capy::run_test::throwing_post_executor, 0>(boost::capy::run_test::throwing_post_executor const&) :158 2x 100.0% 100.0% boost::capy::executor_ref::executor_ref<boost::capy::strand<boost::capy::executor_ref>, 0>(boost::capy::strand<boost::capy::executor_ref> const&) :158 2x 100.0% 100.0% boost::capy::executor_ref::executor_ref<boost::capy::strand<boost::capy::queuing_executor>, 0>(boost::capy::strand<boost::capy::queuing_executor> const&) :158 200008x 100.0% 100.0% boost::capy::executor_ref::executor_ref<boost::capy::strand<boost::capy::test::priority_executor<boost::capy::queuing_executor> >, 0>(boost::capy::strand<boost::capy::test::priority_executor<boost::capy::queuing_executor> > const&) :158 2x 100.0% 100.0% boost::capy::executor_ref::executor_ref<boost::capy::strand<boost::capy::thread_pool::executor_type>, 0>(boost::capy::strand<boost::capy::thread_pool::executor_type> const&) :158 12x 100.0% 100.0% boost::capy::executor_ref::executor_ref<boost::capy::strand_test::testFirstPostRacesShutdown()::locked_executor, 0>(boost::capy::strand_test::testFirstPostRacesShutdown()::locked_executor const&) :158 1000x 100.0% 100.0% boost::capy::executor_ref::executor_ref<boost::capy::strand_test::testInnerPostThrows()::throwing_executor, 0>(boost::capy::strand_test::testInnerPostThrows()::throwing_executor const&) :158 2x 100.0% 100.0% boost::capy::executor_ref::executor_ref<boost::capy::sync_executor, 0>(boost::capy::sync_executor const&) :158 56x 100.0% 100.0% boost::capy::executor_ref::executor_ref<boost::capy::test::blocking_executor, 0>(boost::capy::test::blocking_executor const&) :158 2215x 100.0% 100.0% boost::capy::executor_ref::executor_ref<boost::capy::test::priority_executor<boost::capy::queuing_executor>, 0>(boost::capy::test::priority_executor<boost::capy::queuing_executor> const&) :158 10x 100.0% 100.0% boost::capy::executor_ref::executor_ref<boost::capy::test_executor, 0>(boost::capy::test_executor const&) :158 522x 100.0% 100.0% boost::capy::executor_ref::executor_ref<boost::capy::thread_pool::executor_type, 0>(boost::capy::thread_pool::executor_type const&) :158 36850x 100.0% 100.0% boost::capy::executor_ref::executor_ref<boost::capy::tracking_executor, 0>(boost::capy::tracking_executor const&) :158 2x 100.0% 100.0% boost::capy::executor_ref::executor_ref<trace_loop::executor_type, 0>(trace_loop::executor_type const&) :158 2x 100.0% 100.0% boost::capy::executor_ref::operator bool() const :169 6x 100.0% 100.0% boost::capy::executor_ref::context() const :180 1x 100.0% 100.0% boost::capy::executor_ref::on_work_started() const :191 88x 100.0% 100.0% boost::capy::executor_ref::on_work_finished() const :201 88x 100.0% 100.0% boost::capy::executor_ref::dispatch(boost::capy::continuation&) const :222 142x 100.0% 100.0% boost::capy::executor_ref::post(boost::capy::continuation&) const :241 223557x 100.0% 100.0% boost::capy::executor_ref::operator==(boost::capy::executor_ref const&) const :257 7x 100.0% 100.0% boost::capy::thread_pool::executor_type const* boost::capy::executor_ref::target<boost::capy::thread_pool::executor_type>() const :281 3x 100.0% 100.0% boost::capy::thread_pool::executor_type* boost::capy::executor_ref::target<boost::capy::thread_pool::executor_type>() :290 3x 100.0% 100.0%
Line TLA Hits Source Code
1 //
2 // Copyright (c) 2025 Vinnie Falco (vinnie.falco@gmail.com)
3 // Copyright (c) 2026 Michael Vandeberg
4 //
5 // Distributed under the Boost Software License, Version 1.0. (See accompanying
6 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 //
8 // Official repository: https://github.com/cppalliance/capy
9 //
10
11 #ifndef BOOST_CAPY_EXECUTOR_REF_HPP
12 #define BOOST_CAPY_EXECUTOR_REF_HPP
13
14 #include <boost/capy/detail/config.hpp>
15 #include <boost/capy/detail/type_id.hpp>
16 #include <boost/capy/continuation.hpp>
17 #include <concepts>
18 #include <coroutine>
19 #include <type_traits>
20 #include <utility>
21
22 namespace boost {
23 namespace capy {
24
25 class execution_context;
26
27 namespace detail {
28
29 /** Virtual function table for type-erased executor operations. */
30 struct executor_vtable
31 {
32 execution_context& (*context)(void const*) noexcept;
33 void (*on_work_started)(void const*) noexcept;
34 void (*on_work_finished)(void const*) noexcept;
35 void (*post)(void const*, continuation&);
36 std::coroutine_handle<> (*dispatch)(void const*, continuation&);
37 bool (*equals)(void const*, void const*) noexcept;
38 detail::type_info const* type_id;
39 };
40
41 /** Vtable instance for a specific executor type. */
42 template<class Ex>
43 inline constexpr executor_vtable vtable_for = {
44 // context
45 1x [](void const* p) noexcept -> execution_context& {
46 1x return const_cast<Ex*>(static_cast<Ex const*>(p))->context();
47 },
48 // on_work_started
49 176x [](void const* p) noexcept {
50 88x const_cast<Ex*>(static_cast<Ex const*>(p))->on_work_started();
51 },
52 // on_work_finished
53 176x [](void const* p) noexcept {
54 88x const_cast<Ex*>(static_cast<Ex const*>(p))->on_work_finished();
55 },
56 // post
57 447107x [](void const* p, continuation& c) {
58 223557x static_cast<Ex const*>(p)->post(c);
59 },
60 // dispatch
61 142x [](void const* p, continuation& c) -> std::coroutine_handle<> {
62 142x return static_cast<Ex const*>(p)->dispatch(c);
63 },
64 // equals
65 1x [](void const* a, void const* b) noexcept -> bool {
66 1x return *static_cast<Ex const*>(a) == *static_cast<Ex const*>(b);
67 },
68 // type_id
69 &detail::type_id<Ex>()
70 };
71
72 } // detail
73
74 /** Forwards `dispatch`/`post`/`context` calls through a non-owning, type-erased executor pointer.
75
76 This class provides type erasure for any executor type, enabling
77 runtime polymorphism without virtual functions or allocation.
78 It stores a pointer to the original executor and a pointer to a
79 static vtable. Executors of different types are therefore stored
80 uniformly, while satisfying the full `Executor` concept.
81
82 @par Reference Semantics
83 This class has reference semantics: it does not allocate or own
84 the wrapped executor. Copy operations copy the internal
85 pointers. The caller must ensure the referenced executor outlives
86 all `executor_ref` instances that wrap it.
87
88 @par Thread Safety
89 The `executor_ref` itself is not thread-safe for concurrent
90 modification, but its executor operations are safe to call
91 concurrently if the underlying executor supports it.
92
93 @par Executor Concept
94 This class satisfies the `Executor` concept, making it usable
95 anywhere a concrete executor is expected.
96
97 @par Example
98 @par !example example
99
100
101 @see @ref any_executor, @ref Executor
102 */
103 class executor_ref
104 {
105 void const* ex_ = nullptr;
106 detail::executor_vtable const* vt_ = nullptr;
107
108 public:
109 /** Construct a default instance.
110
111 Constructs an empty `executor_ref`. `operator bool()`,
112 `operator==()`, and `target()` report the empty state;
113 `context()`, `on_work_started()`, `on_work_finished()`,
114 `dispatch()`, and `post()` are undefined behavior until an
115 executor is assigned.
116 */
117 317774x executor_ref() = default;
118
119 /** Construct a copy.
120
121 Copies the internal pointers, preserving identity.
122
123 @param other The reference to copy.
124 */
125 executor_ref(executor_ref const& other) = default;
126
127 /** Rebind to the executor `other` refers to.
128
129 @param other The reference to copy.
130
131 @return A reference to `*this`.
132 */
133 executor_ref& operator=(executor_ref const& other) = default;
134
135 /** Construct from any executor type.
136
137 Captures a reference to the given executor and stores a pointer
138 to the type-specific vtable. The executor must remain valid for
139 the lifetime of this `executor_ref` instance.
140
141 @note The constructor accepts a temporary executor. Binding to a
142 temporary leaves a dangling reference once the full expression
143 ends.
144
145 @param ex The executor to wrap. Must satisfy the `Executor`
146 concept. A pointer to this object is stored
147 internally; the executor must outlive this wrapper.
148 */
149 #if defined(__GNUC__) && !defined(__clang__)
150 // GCC constraint satisfaction caching bug workaround
151 template<class Ex,
152 std::enable_if_t<!std::is_same_v<
153 std::decay_t<Ex>, executor_ref>, int> = 0>
154 #else
155 template<class Ex>
156 requires (!std::same_as<std::decay_t<Ex>, executor_ref>)
157 #endif
158 543688x executor_ref(Ex const& ex) noexcept
159 543688x : ex_(&ex)
160 543688x , vt_(&detail::vtable_for<Ex>)
161 {
162 543688x }
163
164 /** Check whether this instance holds a valid executor.
165
166 @return `true` if constructed with an executor, `false` if
167 default-constructed.
168 */
169 6x explicit operator bool() const noexcept
170 {
171 6x return ex_ != nullptr;
172 }
173
174 /** Return a reference to the associated execution context.
175
176 @pre This instance was constructed with a valid executor.
177
178 @return A reference to the execution context.
179 */
180 1x execution_context& context() const noexcept
181 {
182 1x return vt_->context(ex_);
183 }
184
185 /** Inform the executor that work is beginning.
186
187 Must be paired with a subsequent call to `on_work_finished()`.
188
189 @pre This instance was constructed with a valid executor.
190 */
191 88x void on_work_started() const noexcept
192 {
193 88x vt_->on_work_started(ex_);
194 88x }
195
196 /** Inform the executor that work has completed.
197
198 @pre A preceding call to `on_work_started()` was made.
199 @pre This instance was constructed with a valid executor.
200 */
201 88x void on_work_finished() const noexcept
202 {
203 88x vt_->on_work_finished(ex_);
204 88x }
205
206 /** Dispatch a continuation through the wrapped executor.
207
208 Forwards to the wrapped executor's `dispatch`. That executor
209 returns `c.h` to resume inline, or posts `c` and returns
210 `std::noop_coroutine()`.
211
212 @pre This instance was constructed with a valid executor.
213
214 @par Exception Safety
215 Propagates any exception from the wrapped executor.
216
217 @param c The continuation to dispatch for resumption.
218 Must remain at a stable address until dequeued.
219
220 @return A handle for symmetric transfer or `std::noop_coroutine()`.
221 */
222 142x std::coroutine_handle<> dispatch(continuation& c) const
223 {
224 142x return vt_->dispatch(ex_, c);
225 }
226
227 /** Post a continuation to the wrapped executor.
228
229 Posts the continuation to the executor for later execution
230 and returns. The caller should transfer to `std::noop_coroutine()`
231 after calling this.
232
233 @pre This instance was constructed with a valid executor.
234
235 @par Exception Safety
236 Propagates any exception from the wrapped executor.
237
238 @param c The continuation to post for resumption.
239 Must remain at a stable address until dequeued.
240 */
241 223557x void post(continuation& c) const
242 {
243 223557x vt_->post(ex_, c);
244 223550x }
245
246 /** Compare two executor references for equality.
247
248 Two `executor_ref` instances are equal if they wrap
249 executors of the same type that compare equal. Two empty
250 references are equal, and so are two references to the same
251 executor object.
252
253 @param other The executor reference to compare against.
254
255 @return `true` if both are empty or wrap equal executors of the same type.
256 */
257 7x bool operator==(executor_ref const& other) const noexcept
258 {
259 7x if (ex_ == other.ex_)
260 5x return true;
261 2x if (vt_ != other.vt_)
262 1x return false;
263 1x return vt_->equals(ex_, other.ex_);
264 }
265
266 /** Return a pointer to the wrapped executor if it matches
267 the requested type.
268
269 Performs a type check against the stored executor and
270 returns a typed pointer when the types match, or
271 `nullptr` otherwise. Analogous to
272 `std::any_cast< Executor >( &a )`.
273
274 @tparam Executor The executor type to retrieve.
275
276 @return A pointer to the underlying executor, or
277 `nullptr` if this reference is empty or the type
278 does not match.
279 */
280 template< typename Executor >
281 3x const Executor* target() const noexcept
282 {
283 3x if ( vt_ && *vt_->type_id == detail::type_id< Executor >() )
284 1x return static_cast< Executor const* >( ex_ );
285 2x return nullptr;
286 }
287
288 /// @copydoc target() const
289 template< typename Executor>
290 5x Executor* target() noexcept
291 {
292 5x if ( vt_ && *vt_->type_id == detail::type_id< Executor >() )
293 return const_cast< Executor* >(
294 2x static_cast< Executor const* >( ex_ ));
295 3x return nullptr;
296 }
297 };
298
299 } // capy
300 } // boost
301
302 #endif
303