5 #ifndef DOXYGEN_SKIP_PROPERTY
11 inline namespace event_v2
13 #endif //DOXYGEN_SKIP_PROPERTY
21 using event_impl_ptr = std::shared_ptr<detail::event_v2_impl>;
22 using clock_type = std::chrono::system_clock;
28 event_t(
bool initially =
false);
45 void signal_all()
const noexcept;
53 void signal()
const noexcept;
59 void reset()
const noexcept;
61 struct [[nodiscard]] awaiter;
68 awaiter
operator co_await()
const noexcept;
78 awaiter wait()
const noexcept;
80 template<
class _Btype>
81 struct timeout_awaitor_impl;
83 struct [[nodiscard]] timeout_awaiter;
94 template<
class _Rep,
class _Period>
95 timeout_awaiter wait_for(
const std::chrono::duration<_Rep, _Period>& dt)
const noexcept;
106 template<
class _Clock,
class _Duration>
107 timeout_awaiter wait_until(
const std::chrono::time_point<_Clock, _Duration>& tp)
const noexcept;
110 template<
class _Iter>
111 struct [[nodiscard]] any_awaiter;
114 #ifndef DOXYGEN_SKIP_PROPERTY
115 COMMA_RESUMEF_ENABLE_IF(traits::is_iterator_of_v<_Iter, event_t>)
116 #endif //DOXYGEN_SKIP_PROPERTY
118 #ifndef DOXYGEN_SKIP_PROPERTY
119 RESUMEF_REQUIRES(_IteratorOfT<_Iter, event_t>)
120 #endif //DOXYGEN_SKIP_PROPERTY
121 static auto wait_any(_Iter begin_, _Iter end_)
122 ->any_awaiter<_Iter>;
125 #ifndef DOXYGEN_SKIP_PROPERTY
126 COMMA_RESUMEF_ENABLE_IF(traits::is_container_of_v<_Cont, event_t>)
127 #endif //DOXYGEN_SKIP_PROPERTY
129 #ifndef DOXYGEN_SKIP_PROPERTY
130 RESUMEF_REQUIRES(_ContainerOfT<_Cont, event_t>)
131 #endif //DOXYGEN_SKIP_PROPERTY
132 static auto wait_any(
const _Cont& cnt_)
133 ->any_awaiter<decltype(std::begin(cnt_))>;
135 template<
class _Iter>
136 struct [[nodiscard]] timeout_any_awaiter;
138 template<
class _Rep,
class _Period,
class _Iter
139 #ifndef DOXYGEN_SKIP_PROPERTY
140 COMMA_RESUMEF_ENABLE_IF(traits::is_iterator_of_v<_Iter, event_t>)
141 #endif //DOXYGEN_SKIP_PROPERTY
143 #ifndef DOXYGEN_SKIP_PROPERTY
144 RESUMEF_REQUIRES(_IteratorOfT<_Iter, event_t>)
145 #endif //DOXYGEN_SKIP_PROPERTY
146 static auto wait_any_for(
const std::chrono::duration<_Rep, _Period>& dt, _Iter begin_, _Iter end_)
147 ->timeout_any_awaiter<_Iter>;
149 template<
class _Rep,
class _Period,
class _Cont
150 #ifndef DOXYGEN_SKIP_PROPERTY
151 COMMA_RESUMEF_ENABLE_IF(traits::is_container_of_v<_Cont, event_t>)
152 #endif //DOXYGEN_SKIP_PROPERTY
154 #ifndef DOXYGEN_SKIP_PROPERTY
155 RESUMEF_REQUIRES(_ContainerOfT<_Cont, event_t>)
156 #endif //DOXYGEN_SKIP_PROPERTY
157 static auto wait_any_for(
const std::chrono::duration<_Rep, _Period>& dt,
const _Cont& cnt_)
158 ->timeout_any_awaiter<decltype(std::begin(cnt_))>;
162 template<
class _Iter>
163 struct [[nodiscard]] all_awaiter;
166 #ifndef DOXYGEN_SKIP_PROPERTY
167 COMMA_RESUMEF_ENABLE_IF(traits::is_iterator_of_v<_Iter, event_t>)
168 #endif //DOXYGEN_SKIP_PROPERTY
170 #ifndef DOXYGEN_SKIP_PROPERTY
171 RESUMEF_REQUIRES(_IteratorOfT<_Iter, event_t>)
172 #endif //DOXYGEN_SKIP_PROPERTY
173 static auto wait_all(_Iter begin_, _Iter end_)
174 ->all_awaiter<_Iter>;
177 #ifndef DOXYGEN_SKIP_PROPERTY
178 COMMA_RESUMEF_ENABLE_IF(traits::is_container_of_v<_Cont, event_t>)
179 #endif //DOXYGEN_SKIP_PROPERTY
181 #ifndef DOXYGEN_SKIP_PROPERTY
182 RESUMEF_REQUIRES(_ContainerOfT<_Cont, event_t>)
183 #endif //DOXYGEN_SKIP_PROPERTY
184 static auto wait_all(
const _Cont& cnt_)
185 ->all_awaiter<decltype(std::begin(cnt_))>;
188 template<
class _Iter>
189 struct [[nodiscard]] timeout_all_awaiter;
191 template<
class _Rep,
class _Period,
class _Iter
192 #ifndef DOXYGEN_SKIP_PROPERTY
193 COMMA_RESUMEF_ENABLE_IF(traits::is_iterator_of_v<_Iter, event_t>)
194 #endif //DOXYGEN_SKIP_PROPERTY
196 #ifndef DOXYGEN_SKIP_PROPERTY
197 RESUMEF_REQUIRES(_IteratorOfT<_Iter, event_t>)
198 #endif //DOXYGEN_SKIP_PROPERTY
199 static auto wait_all_for(
const std::chrono::duration<_Rep, _Period>& dt, _Iter begin_, _Iter end_)
200 ->timeout_all_awaiter<_Iter>;
202 template<
class _Rep,
class _Period,
class _Cont
203 #ifndef DOXYGEN_SKIP_PROPERTY
204 COMMA_RESUMEF_ENABLE_IF(traits::is_container_of_v<_Cont, event_t>)
205 #endif //DOXYGEN_SKIP_PROPERTY
207 #ifndef DOXYGEN_SKIP_PROPERTY
208 RESUMEF_REQUIRES(_ContainerOfT<_Cont, event_t>)
209 #endif //DOXYGEN_SKIP_PROPERTY
210 static auto wait_all_for(
const std::chrono::duration<_Rep, _Period>& dt,
const _Cont& cnt_)
211 ->timeout_all_awaiter<decltype(std::begin(cnt_))>;
218 event_impl_ptr _event;