Program Listing for File execution.hpp

Return to documentation for file (include/concore/execution.hpp)

#pragma once

#include <concore/detail/cxx_features.hpp>

#include <exception>

#include <concore/_cpo/_cpo_set_value.hpp>
#include <concore/_cpo/_cpo_set_done.hpp>
#include <concore/_cpo/_cpo_set_error.hpp>
#include <concore/_cpo/_cpo_execute.hpp>
#include <concore/_cpo/_cpo_connect.hpp>
#include <concore/_cpo/_cpo_start.hpp>
#include <concore/_cpo/_cpo_submit.hpp>
#include <concore/_cpo/_cpo_schedule.hpp>
#include <concore/_cpo/_cpo_bulk_execute.hpp>
#include <concore/_concepts/_concepts_executor.hpp>
#include <concore/_concepts/_concepts_receiver.hpp>
#include <concore/_concepts/_concepts_sender.hpp>
#include <concore/_concepts/_concept_sender_to.hpp>
#include <concore/_concepts/_concept_operation_state.hpp>
#include <concore/_concepts/_concept_scheduler.hpp>

namespace concore {
inline namespace v1 {

#if DOXYGEN_BUILD

template <typename Receiver, typename... Vs>
void set_value(Receiver&& r, Vs&&... vs);

struct set_value_t {};

template <typename Receiver>
void set_done(Receiver&& r);

struct set_done_t {};

template <typename Receiver, typename Err>
void set_error(Receiver&& r, Err&& e);

struct set_error_t {};

template <typename Executor, typename Ftor>
void execute(Executor&& e, Ftor&& f);

struct execute_t {};

template <typename Sender, receiver Receiver>
auto connect(Sender&& snd, Receiver&& rcv);

struct connect_t {};

template <operation_state Oper>
void start(Oper&& o);

struct start_t {};

template <sender Sender, receiver Receiver>
void submit(Sender&& snd, Receiver&& rcv);

struct submit_t {};

template <typename Scheduler>
auto schedule(Scheduler&& sched);

struct schedule_t {};

template <typename Executor, typename Ftor, typename Num>
void bulk_execute(Executor&& e, Ftor&& f, Num n);

struct bulk_execute_t {};

struct invocable_archetype {
    void operator()() & noexcept {}
};

template <typename E>
struct executor {};

template <typename E, typename F>
struct executor_of {};

template <typename T, typename E = std::exception_ptr>
struct receiver {};

template <typename T, typename E = std::exception_ptr, typename... Vs>
struct receiver_of {};

template <typename S>
struct sender {};

template <typename S>
struct typed_sender {};

template <typename S, typename R>
struct sender_to {};

template <typename OpState>
struct operation_state {};

template <typename S>
struct scheduler {};

#endif

struct receiver_invocation_error : std::runtime_error, std::nested_exception {
    receiver_invocation_error() noexcept
        : runtime_error("receiver_invocation_error")
        , nested_exception() {}
};

} // namespace v1
} // namespace concore