YACLib
C++ library for concurrent tasks execution
Loading...
Searching...
No Matches
manual.hpp
Go to the documentation of this file.
1#pragma once
2
4#include <yaclib/exe/job.hpp>
6
7#include <cstddef>
8
9namespace yaclib {
10
11/**
12 * TODO(mkornaukhov03) Doxygen
13 */
14class ManualExecutor : public IExecutor {
15 public:
16 [[nodiscard]] Type Tag() const noexcept final;
17
18 [[nodiscard]] bool Alive() const noexcept final;
19
20 void Submit(Job& f) noexcept final;
21
22 [[nodiscard]] std::size_t Drain() noexcept;
23
24 private:
25 detail::List _tasks;
26};
27
29
30} // namespace yaclib
Callable that can be executed in an IExecutor.
Definition job.hpp:12
TODO(mkornaukhov03) Doxygen.
Definition manual.hpp:14
Type Tag() const noexcept final
Return type of this executor.
Definition manual.cpp:6
void Submit(Job &f) noexcept final
Submit given job.
Definition manual.cpp:14
bool Alive() const noexcept final
Return true if executor still alive, that means job passed to submit will be Call.
Definition manual.cpp:10
std::size_t Drain() noexcept
Definition manual.cpp:18
IExecutorPtr MakeManual()
Definition manual.cpp:28
Contract< V, E > MakeContract()
Creates related future and promise.
Definition contract.hpp:25