CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
ExecutionContext.hpp File Reference
#include "CeresEngine/DataTypes.hpp"
#include "CeresEngine/Macros.hpp"
#include "CeresEngine/Foundation/Async.hpp"
#include "CeresEngine/Foundation/Forward.hpp"
#include <asio/defer.hpp>
#include <asio/dispatch.hpp>
#include <asio/io_context.hpp>
#include <asio/post.hpp>
#include <asio/strand.hpp>
#include <asio/any_io_executor.hpp>
#include <asio/execution/execute.hpp>

Go to the source code of this file.

Classes

class  CeresEngine::ExecutionContext
 A context for function object execution. More...
 
class  CeresEngine::ExecutionContext::Service< T >
 
class  CeresEngine::ExecutionContext::Scope
 Scope object that sets the current execution context as current. More...
 
struct  CeresEngine::ExecutorPriority
 Determines the priority to which an executor should schedule its tasks. More...
 
class  CeresEngine::TAnyExecutor< Properties >
 The AnyExecutor type is a polymorphic executor that supports the set of properties required by I/O objects. More...
 
struct  CeresEngine::traits::is_execution_context< T >
 A type trait that checks if a type is a ExecutionContext. More...
 
struct  CeresEngine::traits::is_executor_or_execution_context< T >
 A type trait that checks if a type is an executor or an ExecutionContext. More...
 
class  CeresEngine::InlineExecutor
 An executor that runs anything inline. More...
 
struct  CeresEngine::traits::is_inline_executor< T >
 A type trait that checks if a type is an InlineExecutor. More...
 
class  CeresEngine::ThreadExecutor
 An executor that runs anything in a new thread, like std::async does. More...
 
struct  CeresEngine::traits::is_thread_executor< T >
 A type trait that checks if a type is an ThreadExecutor. More...
 
struct  CeresEngine::traits::is_default_executor< T >
 A type trait that checks if a type is an DefaultExecutor. More...
 

Namespaces

namespace  CeresEngine
 
namespace  CeresEngine::traits
 

Concepts

concept  CeresEngine::traits::executor
 
concept  CeresEngine::traits::execution_context
 
concept  CeresEngine::traits::executor_or_execution_context
 
concept  CeresEngine::traits::inline_executor
 
concept  CeresEngine::traits::thread_executor
 
concept  CeresEngine::traits::default_executor
 

Typedefs

using CeresEngine::ExecutorExecutionContext = asio::execution::context_t
 
template<typename T >
using CeresEngine::ExecutorExecutionContextAs = asio::execution::context_as_t< T >
 
using CeresEngine::ExecutorBlocking = asio::execution::blocking_t
 
using CeresEngine::ExecutorMapping = asio::execution::mapping_t
 
using CeresEngine::ExecutorOccupancy = asio::execution::occupancy_t
 
using CeresEngine::ExecutorOutstandingWork = asio::execution::outstanding_work_t
 
using CeresEngine::ExecutorBulkGuarantee = asio::execution::bulk_guarantee_t
 
using CeresEngine::ExecutorRelationship = asio::execution::relationship_t
 
template<typename T >
using CeresEngine::ExecutorAllocator = asio::execution::allocator_t< T >
 
template<typename Property >
using CeresEngine::ExecutorPreferOnly = asio::execution::prefer_only< Property >
 
template<typename... Properties>
using CeresEngine::AnyExecutorBase = asio::execution::any_executor< Properties..., ExecutorPreferOnly< ExecutorPriority >, ExecutorPreferOnly< ExecutorBlocking::possibly_t >, ExecutorPreferOnly< ExecutorBlocking::never_t >, ExecutorPreferOnly< ExecutorOutstandingWork::tracked_t >, ExecutorPreferOnly< ExecutorOutstandingWork::untracked_t >, ExecutorPreferOnly< ExecutorRelationship::fork_t >, ExecutorPreferOnly< ExecutorRelationship::continuation_t >, ExecutorPreferOnly< ExecutorBulkGuarantee::parallel_t >, ExecutorPreferOnly< ExecutorBulkGuarantee::sequenced_t >, ExecutorPreferOnly< ExecutorBulkGuarantee::unsequenced_t > >
 
using CeresEngine::AnyIOExecutor = TAnyExecutor< ExecutorExecutionContextAs< asio::execution_context & >, ExecutorBlocking::never_t >
 
template<typename Executor >
using CeresEngine::TStrand = asio::strand< Executor >
 
using CeresEngine::Strand = TStrand< AnyExecutor >
 
using CeresEngine::ExecutorWorkGuard = asio::executor_work_guard< AnyExecutor >
 
using CeresEngine::DefaultExecutor = ThreadExecutor
 The default executor to be used when no other executor is provided.
 

Functions

template<traits::executor Executor, typename F >
decltype(autoCeresEngine::defer (Executor executor, F &&func)
 
template<typename F >
decltype(autoCeresEngine::defer (ExecutionContext &executionContext, F &&func)
 
template<typename F >
decltype(autoCeresEngine::defer (F &&func)
 
template<traits::executor Executor>
auto CeresEngine::with (Executor executor)
 
auto CeresEngine::with (ExecutionContext &context)
 
template<traits::executor Executor, typename Func >
auto CeresEngine::with (Executor executor, Func &&func)
 
template<typename Func >
auto CeresEngine::with (ExecutionContext &context, Func &&func)
 
constexpr std::size_t CeresEngine::hardware_concurrency () noexcept
 A version of hardware_concurrency that always returns at least 1.
 
constexpr auto CeresEngine::make_inline_executor ()
 An executor that runs anything inline.
 
auto CeresEngine::make_thread_executor ()
 An executor that runs anything in a new thread, like std::async does.
 
auto CeresEngine::make_default_executor ()
 The default executor to be used when no other executor is provided.
 

Variables

template<typename T >
constexpr bool CeresEngine::traits::is_executor_v = is_executor<T>::value
 
template<typename T >
constexpr bool CeresEngine::traits::is_execution_context_v = is_execution_context<T>::value
 A type trait that checks if a type is a ExecutionContext.
 
template<typename T >
constexpr bool CeresEngine::traits::is_executor_or_execution_context_v = is_executor_or_execution_context<T>::value
 A type trait that checks if a type is an executor or an ExecutionContext.
 
template<typename T >
constexpr bool CeresEngine::traits::is_inline_executor_v = is_inline_executor<T>::value
 A type trait that checks if a type is an InlineExecutor.
 
template<typename T >
constexpr bool CeresEngine::traits::is_thread_executor_v = is_thread_executor<T>::value
 A type trait that checks if a type is an ThreadExecutor.
 
template<typename T >
constexpr bool CeresEngine::traits::is_default_executor_v = is_default_executor<T>::value
 A type trait that checks if a type is an DefaultExecutor.