CeresEngine
0.2.0
A game development framework
Loading...
Searching...
No Matches
ThreadPool.hpp
Go to the documentation of this file.
1
//
2
// CeresEngine - A game development framework
3
//
4
// Created by Rogiel Sulzbach.
5
// Copyright (c) 2018-2022 Rogiel Sulzbach. All rights reserved.
6
//
7
8
#pragma once
9
10
#include "
CeresEngine/Foundation/Threading/ExecutionContext.hpp
"
11
12
#include <asio/thread_pool.hpp>
13
14
namespace
CeresEngine
{
15
40
class
ThreadPool
:
private
asio::thread_pool,
public
ExecutionContext
{
41
using
Super
= asio::thread_pool;
42
43
public
:
44
using
Super::Super;
45
46
public
:
// Thread pool
47
using
Executor
= Super::executor_type;
48
49
using
Super::executor;
50
using
Super::executor_type;
51
using
Super::join;
52
using
Super::stop;
53
using
Super::wait;
54
55
public
:
// ExecutionContext interface
56
[[
nodiscard
]]
AnyExecutor
getExecutor
()
noexcept
override
{
return
executor(); }
57
};
58
59
}
// namespace CeresEngine
ExecutionContext.hpp
CeresEngine::ExecutionContext
A context for function object execution.
Definition
ExecutionContext.hpp:90
CeresEngine::TAnyExecutor<>
CeresEngine::ThreadPool
The thread pool class is an execution context where functions are permitted to run on one of a fixed ...
Definition
ThreadPool.hpp:40
CeresEngine::ThreadPool::getExecutor
AnyExecutor getExecutor() noexcept override
Returns an executor that run execute scheduled commands on the context.
Definition
ThreadPool.hpp:56
CeresEngine::ThreadPool::Super
asio::thread_pool Super
Definition
ThreadPool.hpp:41
CeresEngine::ThreadPool::Executor
Super::executor_type Executor
Definition
ThreadPool.hpp:47
CeresEngine
Definition
Application.hpp:19
CeresEngine::hash
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition
Hash.hpp:25
Sources
CeresEngine
Foundation
Threading
ThreadPool.hpp
Generated by
1.9.8