YACLib
C++ library for concurrent tasks execution
Loading...
Searching...
No Matches
fwd.hpp
Go to the documentation of this file.
1#pragma once
2
3namespace yaclib {
4
5#define YACLIB_DEFINE_VOID_COMPARE(type) \
6 constexpr bool operator==(type, type) noexcept { \
7 return true; \
8 } \
9 constexpr bool operator!=(type, type) noexcept { \
10 return false; \
11 } \
12 constexpr bool operator<(type, type) noexcept { \
13 return false; \
14 } \
15 constexpr bool operator<=(type, type) noexcept { \
16 return true; \
17 } \
18 constexpr bool operator>=(type, type) noexcept { \
19 return true; \
20 } \
21 constexpr bool operator>(type, type) noexcept { \
22 return false; \
23 }
24
25#define YACLIB_DEFINE_VOID_TYPE(type) \
26 struct type {}; \
27 YACLIB_DEFINE_VOID_COMPARE(type)
28
31
32struct DefaultTrait;
33
34template <typename V = void>
35class [[nodiscard]] Result;
36
37template <typename V = void, typename T = DefaultTrait>
38class [[nodiscard]] Task;
39
40template <typename V, typename T>
41class FutureBase;
42
43template <typename V = void, typename T = DefaultTrait>
44class [[nodiscard]] Future;
45
46template <typename V = void, typename T = DefaultTrait>
47class [[nodiscard]] FutureOn;
48
49template <typename V = void, typename T = DefaultTrait>
50class [[nodiscard]] Promise;
51
52template <typename V, typename T>
54
55template <typename V = void, typename T = DefaultTrait>
56class [[nodiscard]] SharedFuture;
57
58template <typename V = void, typename T = DefaultTrait>
60
61template <typename V = void, typename T = DefaultTrait>
62class [[nodiscard]] SharedPromise;
63
64} // namespace yaclib
Provides a mechanism to access the result of async operations.
Definition future.hpp:20
Provides a mechanism to access the result of async operations.
Definition future.hpp:247
Provides a mechanism to access the result of async operations.
Definition future.hpp:213
Encapsulated return value from caller.
Definition result.hpp:52
Provides a mechanism to schedule the some async operations TODO(MBkkt) add description.
Definition task.hpp:25
#define YACLIB_DEFINE_VOID_TYPE(type)
Definition fwd.hpp:25
Contract< V, T > MakeContract()
Creates related future and promise.
Definition contract.hpp:25
Trait used by default for all async abstractions, a separate struct so it can be forward declared.
Definition result.hpp:271