CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::EmscriptenRunLoop::Executor Class Reference

An executor object that dispatches calls to the CoreFoundation CFRunLoop. More...

#include <CeresEngine/Platform/Emscripten/EmscriptenRunLoop.hpp>

Public Member Functions

 Executor (const Executor &)=default
 
Executoroperator= (const Executor &)=default
 
 Executor (Executor &&)=default
 
Executoroperator= (Executor &&)=default
 
EmscriptenRunLoopcontext () const noexcept
 Obtain the underlying execution context.
 
void on_work_started () const noexcept
 Inform the executor that it has some outstanding work to do.
 
void on_work_finished () const noexcept
 Inform the executor that some work is no longer outstanding.
 

Private Member Functions

 Executor (EmscriptenRunLoop *const executionContext, const ExecutorBlocking blockingProperty=ExecutorBlocking::never)
 Creates a new Executor instance.
 
EmscriptenRunLoopquery (ExecutorExecutionContext) const noexcept
 Query the current value of the context property.
 
ExecutorBlocking query (ExecutorBlocking) const noexcept
 Query the current value of the blocking property.
 
std::size_t query (ExecutorOccupancy) const noexcept
 Query the occupancy (recommended number of work items) for the system context.
 
template<typename OtherAllocator >
std::allocator< voidquery (ExecutorAllocator< OtherAllocator >) const noexcept
 Query the current value of the allocator property.
 
std::allocator< voidquery (ExecutorAllocator< void >) const noexcept
 Query the current value of the allocator property.
 
Executor require (const ExecutorBlocking blocking) const
 Obtain an executor with the given blocking property.
 
template<typename Function >
void execute (ASIO_MOVE_ARG(Function) f) const
 Execution function.
 

Static Private Member Functions

static constexpr ExecutorMapping query (ExecutorMapping) noexcept
 Query the current value of the mapping property.
 
static constexpr ExecutorRelationship query (ExecutorRelationship) noexcept
 Query the current value of the relationship property.
 
static constexpr ExecutorOutstandingWork query (ExecutorOutstandingWork) noexcept
 Query the current value of the outstanding_work property.
 
static constexpr ExecutorBulkGuarantee query (ExecutorBulkGuarantee) noexcept
 Query the current value of the bulk_guarantee property.
 

Private Attributes

EmscriptenRunLoopmExecutionContext
 The execution context that the executor will use.
 
ExecutorBlocking mBlockingProperty = ExecutorBlocking::never
 A property that customizes the blocking behavior of the executor.
 

Friends

class EmscriptenRunLoop
 
struct asio_query_fn::impl
 
struct asio::execution::detail::context_t< 0 >
 
struct asio::execution::detail::mapping_t< 0 >
 
struct asio::execution::detail::blocking_t< 0 >
 
struct asio::execution::detail::relationship_t< 0 >
 
struct asio::execution::detail::outstanding_work_t< 0 >
 
struct asio::execution::detail::bulk_guarantee_t< 0 >
 
struct asio::execution::detail::occupancy_t< 0 >
 
struct asio_require_fn::impl
 
struct asio_prefer_fn::impl
 
struct asio_execution_execute_fn::impl
 
bool operator== (const Executor &, const Executor &) noexcept
 Compare two executors for equality.
 
bool operator!= (const Executor &, const Executor &) noexcept
 Compare two executors for inequality.
 

Detailed Description

An executor object that dispatches calls to the CoreFoundation CFRunLoop.

Constructor & Destructor Documentation

◆ Executor() [1/3]

CeresEngine::EmscriptenRunLoop::Executor::Executor ( EmscriptenRunLoop *const  executionContext,
const ExecutorBlocking  blockingProperty = ExecutorBlocking::never 
)
inlineexplicitprivate

Creates a new Executor instance.

Parameters
executionContextThe owning execution context.
blockingPropertyA property that customizes the blocking behavior of the executor.

◆ Executor() [2/3]

CeresEngine::EmscriptenRunLoop::Executor::Executor ( const Executor )
default

◆ Executor() [3/3]

CeresEngine::EmscriptenRunLoop::Executor::Executor ( Executor &&  )
default

Member Function Documentation

◆ context()

EmscriptenRunLoop & CeresEngine::EmscriptenRunLoop::Executor::context ( ) const
inlinenoexcept

Obtain the underlying execution context.

◆ execute()

template<typename Function >
void CeresEngine::EmscriptenRunLoop::Executor::execute ( ASIO_MOVE_ARG(Function f) const
inlineprivate

Execution function.

◆ on_work_finished()

void CeresEngine::EmscriptenRunLoop::Executor::on_work_finished ( ) const
inlinenoexcept

Inform the executor that some work is no longer outstanding.

◆ on_work_started()

void CeresEngine::EmscriptenRunLoop::Executor::on_work_started ( ) const
inlinenoexcept

Inform the executor that it has some outstanding work to do.

◆ operator=() [1/2]

Executor & CeresEngine::EmscriptenRunLoop::Executor::operator= ( const Executor )
default

◆ operator=() [2/2]

Executor & CeresEngine::EmscriptenRunLoop::Executor::operator= ( Executor &&  )
default

◆ query() [1/9]

std::allocator< void > CeresEngine::EmscriptenRunLoop::Executor::query ( ExecutorAllocator< OtherAllocator ) const
inlineprivatenoexcept

Query the current value of the allocator property.

◆ query() [2/9]

std::allocator< void > CeresEngine::EmscriptenRunLoop::Executor::query ( ExecutorAllocator< void ) const
inlineprivatenoexcept

Query the current value of the allocator property.

◆ query() [3/9]

ExecutorBlocking CeresEngine::EmscriptenRunLoop::Executor::query ( ExecutorBlocking  ) const
inlineprivatenoexcept

Query the current value of the blocking property.

◆ query() [4/9]

static constexpr ExecutorBulkGuarantee CeresEngine::EmscriptenRunLoop::Executor::query ( ExecutorBulkGuarantee  )
inlinestaticconstexprprivatenoexcept

Query the current value of the bulk_guarantee property.

◆ query() [5/9]

EmscriptenRunLoop & CeresEngine::EmscriptenRunLoop::Executor::query ( ExecutorExecutionContext  ) const
inlineprivatenoexcept

Query the current value of the context property.

◆ query() [6/9]

static constexpr ExecutorMapping CeresEngine::EmscriptenRunLoop::Executor::query ( ExecutorMapping  )
inlinestaticconstexprprivatenoexcept

Query the current value of the mapping property.

◆ query() [7/9]

std::size_t CeresEngine::EmscriptenRunLoop::Executor::query ( ExecutorOccupancy  ) const
inlineprivatenoexcept

Query the occupancy (recommended number of work items) for the system context.

◆ query() [8/9]

static constexpr ExecutorOutstandingWork CeresEngine::EmscriptenRunLoop::Executor::query ( ExecutorOutstandingWork  )
inlinestaticconstexprprivatenoexcept

Query the current value of the outstanding_work property.

◆ query() [9/9]

static constexpr ExecutorRelationship CeresEngine::EmscriptenRunLoop::Executor::query ( ExecutorRelationship  )
inlinestaticconstexprprivatenoexcept

Query the current value of the relationship property.

◆ require()

Executor CeresEngine::EmscriptenRunLoop::Executor::require ( const ExecutorBlocking  blocking) const
inlineprivate

Obtain an executor with the given blocking property.

Do not call this function directly. It is intended for use with the require customisation point.

For example:

auto ex1 = threadPool.getExecutor();
auto ex2 = require(ex1, ExecutorBlockingProperty::possibly);
Executor require(const ExecutorBlocking blocking) const
Obtain an executor with the given blocking property.
Definition EmscriptenRunLoop.hpp:129
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25

Friends And Related Symbol Documentation

◆ asio::execution::detail::blocking_t< 0 >

friend struct asio::execution::detail::blocking_t< 0 >
friend

◆ asio::execution::detail::bulk_guarantee_t< 0 >

friend struct asio::execution::detail::bulk_guarantee_t< 0 >
friend

◆ asio::execution::detail::context_t< 0 >

friend struct asio::execution::detail::context_t< 0 >
friend

◆ asio::execution::detail::mapping_t< 0 >

friend struct asio::execution::detail::mapping_t< 0 >
friend

◆ asio::execution::detail::occupancy_t< 0 >

friend struct asio::execution::detail::occupancy_t< 0 >
friend

◆ asio::execution::detail::outstanding_work_t< 0 >

friend struct asio::execution::detail::outstanding_work_t< 0 >
friend

◆ asio::execution::detail::relationship_t< 0 >

friend struct asio::execution::detail::relationship_t< 0 >
friend

◆ asio_execution_execute_fn::impl

friend struct asio_execution_execute_fn::impl
friend

◆ asio_prefer_fn::impl

friend struct asio_prefer_fn::impl
friend

◆ asio_query_fn::impl

friend struct asio_query_fn::impl
friend

◆ asio_require_fn::impl

friend struct asio_require_fn::impl
friend

◆ EmscriptenRunLoop

◆ operator!=

bool operator!= ( const Executor ,
const Executor  
)
friend

Compare two executors for inequality.

◆ operator==

bool operator== ( const Executor ,
const Executor  
)
friend

Compare two executors for equality.

Member Data Documentation

◆ mBlockingProperty

ExecutorBlocking CeresEngine::EmscriptenRunLoop::Executor::mBlockingProperty = ExecutorBlocking::never
private

A property that customizes the blocking behavior of the executor.

◆ mExecutionContext

EmscriptenRunLoop* CeresEngine::EmscriptenRunLoop::Executor::mExecutionContext
private

The execution context that the executor will use.


The documentation for this class was generated from the following file: