Debian Codegraph @

yo/coroutines/demo/fsa/letter/letter.h

raw symbols SCIP
1 #ifndef INCLUDED_LETTER_
2 #define INCLUDED_LETTER_
3
4 #include "../../promisebase/promisebase.h"
5 #include "../awaiter/awaiter.h"
6
7 #include "../start/start.h"
8 #include "../digit/digit.h"
9 #include "../done/done.h"
10
11 // this is also the Awaiter class
12 class Letter: public Awaiter
13 {
14 struct State: public PromiseBase<Letter, State>
15 {
16 };
17
18 std::coroutine_handle<State> d_handle;
19
20 public:
21 using promise_type = State;
22 using Handle = std::coroutine_handle<State>;
23
24 explicit Letter(Handle handle);
25 ~Letter();
26
27 template <typename HandleType>
28 std::coroutine_handle<State> await_suspend(HandleType const &handle);
29 };
30
31 template <typename HandleType>
32 inline std::coroutine_handle<Letter::State> Letter::await_suspend(
33 HandleType const &handle)
34 {
35 return d_handle;
36 }
37
38 extern Letter g_letter;
39
40 #endif