| 159 | } // namespace boost |
| 160 | |
| 161 | struct either_blocking_executor |
| 162 | { |
| 163 | execution::blocking_t blocking_; |
| 164 | |
| 165 | explicit either_blocking_executor(execution::blocking_t b) |
| 166 | : blocking_(b) |
| 167 | { |
| 168 | } |
| 169 | |
| 170 | execution::blocking_t query(execution::blocking_t) const noexcept |
| 171 | { |
| 172 | return blocking_; |
| 173 | } |
| 174 | |
| 175 | either_blocking_executor require(execution::blocking_t::possibly_t) const |
| 176 | { |
| 177 | return either_blocking_executor(execution::blocking.possibly); |
| 178 | } |
| 179 | |
| 180 | either_blocking_executor require(execution::blocking_t::never_t) const |
| 181 | { |
| 182 | return either_blocking_executor(execution::blocking.never); |
| 183 | } |
| 184 | |
| 185 | template <typename F> |
| 186 | void execute(const F&) const |
| 187 | { |
| 188 | if (blocking_ == execution::blocking.never) |
| 189 | ++never_blocking_count; |
| 190 | else |
| 191 | ++possibly_blocking_count; |
| 192 | } |
| 193 | |
| 194 | friend bool operator==(const either_blocking_executor& a, |
| 195 | const either_blocking_executor& b) noexcept |
| 196 | { |
| 197 | return a.blocking_ == b.blocking_; |
| 198 | } |
| 199 | |
| 200 | friend bool operator!=(const either_blocking_executor& a, |
| 201 | const either_blocking_executor& b) noexcept |
| 202 | { |
| 203 | return a.blocking_ != b.blocking_; |
| 204 | } |
| 205 | }; |
| 206 | |
| 207 | namespace boost { |
| 208 | namespace asio { |
no outgoing calls
no test coverage detected