15#include <asio/execution.hpp>
73 friend struct asio::execution::detail::context_t<0>;
74 friend struct asio::execution::detail::mapping_t<0>;
75 friend struct asio::execution::detail::blocking_t<0>;
76 friend struct asio::execution::detail::relationship_t<0>;
77 friend struct asio::execution::detail::outstanding_work_t<0>;
78 friend struct asio::execution::detail::bulk_guarantee_t<0>;
79 friend struct asio::execution::detail::occupancy_t<0>;
105 static std::allocator<void> allocator;
111 static std::allocator<void> allocator;
#define CE_ASSERT(...)
Definition Macros.hpp:323
An executor object that dispatches calls to the CoreFoundation CFRunLoop.
Definition EmscriptenRunLoop.hpp:24
ExecutorBlocking query(ExecutorBlocking) const noexcept
Query the current value of the blocking property.
Definition EmscriptenRunLoop.hpp:88
Executor(const Executor &)=default
friend struct asio_prefer_fn::impl
Definition EmscriptenRunLoop.hpp:117
EmscriptenRunLoop * mExecutionContext
The execution context that the executor will use.
Definition EmscriptenRunLoop.hpp:29
static constexpr ExecutorRelationship query(ExecutorRelationship) noexcept
Query the current value of the relationship property.
Definition EmscriptenRunLoop.hpp:91
void on_work_started() const noexcept
Inform the executor that it has some outstanding work to do.
Definition EmscriptenRunLoop.hpp:53
Executor(EmscriptenRunLoop *const executionContext, const ExecutorBlocking blockingProperty=ExecutorBlocking::never)
Creates a new Executor instance.
Definition EmscriptenRunLoop.hpp:39
static constexpr ExecutorBulkGuarantee query(ExecutorBulkGuarantee) noexcept
Query the current value of the bulk_guarantee property.
Definition EmscriptenRunLoop.hpp:97
void execute(ASIO_MOVE_ARG(Function) f) const
Execution function.
Definition EmscriptenRunLoop.hpp:135
friend struct asio_execution_execute_fn::impl
Definition EmscriptenRunLoop.hpp:132
EmscriptenRunLoop & query(ExecutorExecutionContext) const noexcept
Query the current value of the context property.
Definition EmscriptenRunLoop.hpp:82
static constexpr ExecutorMapping query(ExecutorMapping) noexcept
Query the current value of the mapping property.
Definition EmscriptenRunLoop.hpp:85
Executor require(const ExecutorBlocking blocking) const
Obtain an executor with the given blocking property.
Definition EmscriptenRunLoop.hpp:129
friend struct asio_require_fn::impl
Definition EmscriptenRunLoop.hpp:116
Executor(Executor &&)=default
friend bool operator!=(const Executor &, const Executor &) noexcept
Compare two executors for inequality.
Definition EmscriptenRunLoop.hpp:69
friend bool operator==(const Executor &, const Executor &) noexcept
Compare two executors for equality.
Definition EmscriptenRunLoop.hpp:66
Executor & operator=(const Executor &)=default
ExecutorBlocking mBlockingProperty
A property that customizes the blocking behavior of the executor.
Definition EmscriptenRunLoop.hpp:32
static constexpr ExecutorOutstandingWork query(ExecutorOutstandingWork) noexcept
Query the current value of the outstanding_work property.
Definition EmscriptenRunLoop.hpp:94
Executor & operator=(Executor &&)=default
void on_work_finished() const noexcept
Inform the executor that some work is no longer outstanding.
Definition EmscriptenRunLoop.hpp:59
std::allocator< void > query(ExecutorAllocator< void >) const noexcept
Query the current value of the allocator property.
Definition EmscriptenRunLoop.hpp:110
std::size_t query(ExecutorOccupancy) const noexcept
Query the occupancy (recommended number of work items) for the system context.
Definition EmscriptenRunLoop.hpp:101
friend struct asio_query_fn::impl
Definition EmscriptenRunLoop.hpp:72
EmscriptenRunLoop & context() const noexcept
Obtain the underlying execution context.
Definition EmscriptenRunLoop.hpp:50
std::allocator< void > query(ExecutorAllocator< OtherAllocator >) const noexcept
Query the current value of the allocator property.
Definition EmscriptenRunLoop.hpp:104
Abstracts a CoreFoundation CFRunLoop as an ASIO execution context.
Definition EmscriptenRunLoop.hpp:20
void onWorkFinished() noexcept
Inform the executor that some work is no longer outstanding.
executor_type get_executor() noexcept
Returns an executor that run execute scheduled commands on the context.
Definition EmscriptenRunLoop.hpp:181
EmscriptenRunLoop() noexcept
Creates a new emscripten run loop instance for the current thread.
void schedule(UniqueFunction< void()> function, ExecutorBlocking blockingProperty)
Schedules a new function to be run in the run loop.
void stop() final
Stops the execution of the run loop.
AnyExecutor getExecutor() noexcept final
Returns an executor that run execute scheduled commands on the context.
void onWorkStarted() noexcept
Inform the executor that it has some outstanding work to do.
Scope mScope
A scope for the run loop object.
Definition EmscriptenRunLoop.hpp:146
void run() final
Starts running the run loop.
pthread_t mThread
The CoreFoundation CFRunLoop instance to execute commands on.
Definition EmscriptenRunLoop.hpp:143
Scope object that sets the current execution context as current.
Definition ExecutionContext.hpp:180
An ASIO execution context that wraps the operating system run loop.
Definition RunLoop.hpp:17
Definition Application.hpp:19
asio::execution::context_t ExecutorExecutionContext
Definition ExecutionContext.hpp:208
asio::execution::relationship_t ExecutorRelationship
Definition ExecutionContext.hpp:215
asio::execution::mapping_t ExecutorMapping
Definition ExecutionContext.hpp:211
asio::execution::bulk_guarantee_t ExecutorBulkGuarantee
Definition ExecutionContext.hpp:214
asio::execution::occupancy_t ExecutorOccupancy
Definition ExecutionContext.hpp:212
FunctionBase< true, true, fu2::capacity_default, true, false, Signatures... > Function
An owning copyable function wrapper for arbitrary callable types.
Definition Function.hpp:54
asio::execution::allocator_t< T > ExecutorAllocator
Definition ExecutionContext.hpp:216
asio::execution::blocking_t ExecutorBlocking
Definition ExecutionContext.hpp:210
asio::execution::outstanding_work_t ExecutorOutstandingWork
Definition ExecutionContext.hpp:213
ASIO_MOVE_ARG(CompletionToken) token)
Definition IdleService.hpp:42
FunctionBase< true, false, fu2::capacity_default, true, false, Signatures... > UniqueFunction
An owning non copyable function wrapper for arbitrary callable types.
Definition Function.hpp:59
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25