| 56 | }; |
| 57 | |
| 58 | class counting_executor : public concurrencpp::executor { |
| 59 | |
| 60 | private: |
| 61 | std::atomic_size_t m_invocation_count; |
| 62 | |
| 63 | public: |
| 64 | counting_executor() : executor("counting executor"), m_invocation_count(0) {} |
| 65 | |
| 66 | void enqueue(concurrencpp::task task) override { |
| 67 | ++m_invocation_count; |
| 68 | task(); |
| 69 | } |
| 70 | |
| 71 | void enqueue(std::span<concurrencpp::task>) override { |
| 72 | // do nothing |
| 73 | } |
| 74 | |
| 75 | int max_concurrency_level() const noexcept override { |
| 76 | return 0; |
| 77 | } |
| 78 | |
| 79 | bool shutdown_requested() const noexcept override { |
| 80 | return false; |
| 81 | } |
| 82 | |
| 83 | void shutdown() noexcept override { |
| 84 | // do nothing |
| 85 | } |
| 86 | |
| 87 | size_t invocation_count() const noexcept { |
| 88 | return m_invocation_count.load(); |
| 89 | } |
| 90 | }; |
| 91 | |
| 92 | class recording_executor : public concurrencpp::executor { |
| 93 |
nothing calls this directly
no outgoing calls
no test coverage detected