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

An executor object that dispatches calls to a libdispatch queue. More...

#include <CeresEngine/Platform/Apple/AppleDispatchQueue.hpp>

Public Member Functions

 Executor (const Executor &)=default
 
Executoroperator= (const Executor &)=default
 
 Executor (Executor &&)=default
 
Executoroperator= (Executor &&)=default
 
AppleDispatchQueuecontext () 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 (AppleDispatchQueue &executionContext, ExecutorBlocking blockingProperty=ExecutorBlocking::never, ExecutorPriority priority=ExecutorPriority::Normal)
 Creates a new Executor instance.
 
AppleDispatchQueuequery (ExecutorExecutionContext) const noexcept
 Query the current value of the context property.
 
ExecutorBlocking query (ExecutorBlocking) const noexcept
 Query the current value of the blocking property.
 
ExecutorPriority query (ExecutorPriority) const noexcept
 Query the current value of the priority 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 (ExecutorBlocking blocking) const
 Obtain an executor with the given blocking property.
 
Executor require (ExecutorPriority newPriority) const
 Obtain an executor with the given priority 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

AppleDispatchQueuemExecutionContext
 The execution context that the executor will use.
 
ExecutorBlocking mBlockingProperty = ExecutorBlocking::never
 A property that customizes the blocking behavior of the executor.
 
ExecutorPriority mPriority = ExecutorPriority::Normal
 A property that customizes the priority of the executor tasks.
 

Friends

class AppleDispatchQueue
 
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 &lhs, const Executor &rhs) noexcept
 Compare two executors for equality.
 
bool operator!= (const Executor &lhs, const Executor &rhs) noexcept
 Compare two executors for inequality.
 

Detailed Description

An executor object that dispatches calls to a libdispatch queue.

Constructor & Destructor Documentation

◆ Executor() [1/3]

CeresEngine::AppleDispatchQueue::Executor::Executor ( AppleDispatchQueue executionContext,
ExecutorBlocking  blockingProperty = ExecutorBlocking::never,
ExecutorPriority  priority = ExecutorPriority::Normal 
)
inlineexplicitprivate

Creates a new Executor instance.

Parameters
executionContextThe owning execution context.
blockingPropertyA property that customizes the blocking behavior of the executor.
priorityThe priority to execute submitted tasks with.

◆ Executor() [2/3]

CeresEngine::AppleDispatchQueue::Executor::Executor ( const Executor )
default

◆ Executor() [3/3]

CeresEngine::AppleDispatchQueue::Executor::Executor ( Executor &&  )
default

Member Function Documentation

◆ context()

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

Obtain the underlying execution context.

◆ execute()

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

Execution function.

◆ on_work_finished()

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

Inform the executor that some work is no longer outstanding.

◆ on_work_started()

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

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

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ query() [1/10]

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

Query the current value of the allocator property.

◆ query() [2/10]

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

Query the current value of the allocator property.

◆ query() [3/10]

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

Query the current value of the blocking property.

◆ query() [4/10]

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

Query the current value of the bulk_guarantee property.

◆ query() [5/10]

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

Query the current value of the context property.

◆ query() [6/10]

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

Query the current value of the mapping property.

◆ query() [7/10]

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

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

◆ query() [8/10]

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

Query the current value of the outstanding_work property.

◆ query() [9/10]

ExecutorPriority CeresEngine::AppleDispatchQueue::Executor::query ( ExecutorPriority  ) const
inlineprivatenoexcept

Query the current value of the priority property.

◆ query() [10/10]

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

Query the current value of the relationship property.

◆ require() [1/2]

Executor CeresEngine::AppleDispatchQueue::Executor::require ( 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(ExecutorBlocking blocking) const
Obtain an executor with the given blocking property.
Definition AppleDispatchQueue.hpp:205
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25

◆ require() [2/2]

Executor CeresEngine::AppleDispatchQueue::Executor::require ( ExecutorPriority  newPriority) const
inlineprivate

Obtain an executor with the given priority property.

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

For example:

auto ex1 = threadPool.getExecutor();
static const ExecutorPriority High
The default value for high-priority tasks.
Definition ExecutionContext.hpp:253

Friends And Related Symbol Documentation

◆ AppleDispatchQueue

◆ 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

◆ operator!=

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

Compare two executors for inequality.

◆ operator==

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

Compare two executors for equality.

Member Data Documentation

◆ mBlockingProperty

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

A property that customizes the blocking behavior of the executor.

◆ mExecutionContext

AppleDispatchQueue* CeresEngine::AppleDispatchQueue::Executor::mExecutionContext
private

The execution context that the executor will use.

◆ mPriority

ExecutorPriority CeresEngine::AppleDispatchQueue::Executor::mPriority = ExecutorPriority::Normal
private

A property that customizes the priority of the executor tasks.


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