xref: /aosp_15_r20/external/pigweed/pw_async2/reference.rst (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1.. _module-pw_async2-reference:
2
3=========
4Reference
5=========
6.. pigweed-module-subpage::
7   :name: pw_async2
8
9.. _module-pw_async2-reference-cpp:
10
11-----------------
12C++ API reference
13-----------------
14.. TODO: https://pwbug.dev/376082608 - Remove ``:private-members:``.
15
16.. doxygenclass:: pw::async2::Task
17  :members:
18  :private-members:
19
20.. doxygenclass:: pw::async2::Poll
21  :members:
22
23.. doxygenfunction:: pw::async2::Ready()
24
25.. doxygenfunction:: pw::async2::Ready(std::in_place_t, Args&&... args)
26
27.. doxygenfunction:: pw::async2::Ready(T&& value)
28
29.. doxygenfunction:: pw::async2::Pending()
30
31.. doxygenclass:: pw::async2::Context
32  :members:
33
34.. doxygenclass:: pw::async2::Waker
35  :members:
36
37.. c:macro:: PW_ASYNC_STORE_WAKER
38
39  Arguments: ``Context& cx, Waker& waker_out, StringLiteral wait_reason_string``
40
41  Stores a waker associated with the current context in ``waker_out``.
42  When ``waker_out`` is later awoken with :cpp:func:`pw::async2::Waker::Wake`,
43  the :cpp:class:`pw::async2::Task` associated with ``cx`` will be awoken and
44  its ``DoPend`` method will be invoked again.
45
46.. c:macro:: PW_ASYNC_CLONE_WAKER
47
48  Arguments: ``Waker& waker_in, Waker& waker_out, StringLiteral wait_reason_string``
49
50  Stores a waker associated with ``waker_in`` in ``waker_out``.
51  When ``waker_out`` is later awoken with :cpp:func:`pw::async2::Waker::Wake`,
52  the :cpp:class:`pw::async2::Task` associated with ``waker_in`` will be awoken
53  and its ``DoPend`` method will be invoked again.
54
55.. doxygenclass:: pw::async2::Dispatcher
56  :members:
57
58.. doxygenclass:: pw::async2::Coro
59  :members:
60
61.. doxygenclass:: pw::async2::CoroContext
62  :members:
63
64.. doxygenclass:: pw::async2::TimeProvider
65   :members:
66
67.. doxygenfunction:: pw::async2::GetSystemTimeProvider
68
69.. doxygenclass:: pw::async2::SimulatedTimeProvider
70   :members:
71
72.. _module-pw_async2-reference-cpp-utilities:
73
74Utilities
75=========
76.. doxygenfunction:: pw::async2::EnqueueHeapFunc
77
78.. doxygenfunction:: pw::async2::AllocateTask(pw::allocator::Allocator& allocator, Pendable&& pendable)
79
80.. doxygenfunction:: pw::async2::AllocateTask(pw::allocator::Allocator& allocator, Args&&... args)
81
82.. doxygenclass:: pw::async2::CoroOrElseTask
83  :members:
84
85.. doxygenclass:: pw::async2::Join
86  :members:
87
88.. doxygenclass:: pw::async2::PendFuncTask
89  :members:
90
91.. doxygenclass:: pw::async2::PendableAsTask
92  :members:
93
94.. doxygenfunction:: pw::async2::MakeOnceSenderAndReceiver
95
96.. doxygenclass:: pw::async2::OnceSender
97  :members:
98
99.. doxygenclass:: pw::async2::OnceReceiver
100  :members:
101
102.. doxygenfunction:: pw::async2::MakeOnceRefSenderAndReceiver
103
104.. doxygenclass:: pw::async2::OnceRefSender
105  :members:
106
107.. doxygenclass:: pw::async2::OnceRefReceiver
108  :members:
109