kokkos-execution 0.0.1
Loading...
Searching...
No Matches
receiver.hpp
Go to the documentation of this file.
1#ifndef KOKKOS_EXECUTION_IMPL_RECEIVER_HPP
2#define KOKKOS_EXECUTION_IMPL_RECEIVER_HPP
3
5
7
9
11template <typename ParentOp, typename Env = stdexec::env_of_t<ParentOp>>
12struct Receiver {
13 using receiver_concept = stdexec::receiver_tag;
14
15 ParentOp* parent_op;
16
17 void set_value() && noexcept {
18 parent_op->complete(stdexec::set_value);
19 }
20
21 template <typename Error>
22 void set_error(Error&& error) && noexcept {
23 parent_op->complete(stdexec::set_error, std::forward<Error>(error));
24 }
25
26 void set_stopped() && noexcept {
27 parent_op->complete(stdexec::set_stopped);
28 }
29
30 [[nodiscard]]
31 constexpr auto get_env() const noexcept -> stdexec::__fwd_env_t<Env> {
32 return stdexec::__fwd_env(stdexec::get_env(*parent_op));
33 }
34};
35
36} // namespace Kokkos::Execution::Impl
37
38#endif // KOKKOS_EXECUTION_IMPL_RECEIVER_HPP
Receiver for an object parent_op that implements complete.
Definition receiver.hpp:12
constexpr auto get_env() const noexcept -> stdexec::__fwd_env_t< Env >
Definition receiver.hpp:31
void set_error(Error &&error) &&noexcept
Definition receiver.hpp:22