MCPcopy Create free account
hub / github.com/boostorg/beast / test_executor

Class test_executor

test/beast/core/bind_handler.cpp:81–623  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79 }
80
81 class test_executor
82 {
83 bind_handler_test& s_;
84
85#if defined(BOOST_ASIO_NO_TS_EXECUTORS)
86 net::any_io_executor ex_;
87
88 // Storing the blocking property as a member is not strictly necessary,
89 // as we could simply forward the calls
90 // require(ex_, blocking.possibly)
91 // and
92 // require(ex_, blocking.never)
93 // to the underlying executor, and then
94 // query(ex_, blocking)
95 // when required. This forwarding approach is used here for the
96 // outstanding_work property.
97 net::execution::blocking_t blocking_;
98
99#else // defined(BOOST_ASIO_NO_TS_EXECUTORS)
100 net::io_context::executor_type ex_;
101#endif // defined(BOOST_ASIO_NO_TS_EXECUTORS)
102 public:
103 test_executor(
104 test_executor const&) = default;
105
106 test_executor(
107 bind_handler_test& s,
108 net::io_context& ioc)
109 : s_(s)
110 , ex_(ioc.get_executor())
111#if defined(BOOST_ASIO_NO_TS_EXECUTORS)
112 , blocking_(net::execution::blocking.possibly)
113#endif
114 {
115 }
116
117 bool operator==(
118 test_executor const& other) const noexcept
119 {
120 return ex_ == other.ex_;
121 }
122
123 bool operator!=(
124 test_executor const& other) const noexcept
125 {
126 return ex_ != other.ex_;
127 }
128
129#if defined(BOOST_ASIO_NO_TS_EXECUTORS)
130
131 net::execution_context&
132 query(
133 net::execution::context_t c) const noexcept
134 {
135 return net::query(ex_, c);
136 }
137
138 net::execution::blocking_t

Callers 2

testBindHandlerMethod · 0.70
testBindFrontHandlerMethod · 0.70

Calls 2

get_executorMethod · 0.45
contextMethod · 0.45

Tested by

no test coverage detected