Thread System 0.3.1
High-performance C++20 thread pool with work stealing and DAG scheduling
Loading...
Searching...
No Matches
kcenon::thread::adapters::common_executor_factory Class Reference

Factory for creating IExecutor adapters from thread_pool instances. More...

#include <common_executor_adapter.h>

Collaboration diagram for kcenon::thread::adapters::common_executor_factory:
Collaboration graph

Static Public Member Functions

static std::shared_ptr< common::interfaces::IExecutor > create_from_thread_pool (std::shared_ptr< kcenon::thread::thread_pool > pool)
 Create an IExecutor adapter from a thread_pool.
 

Detailed Description

Factory for creating IExecutor adapters from thread_pool instances.

Provides a convenient way to create thread_pool_executor_adapter instances.

Example Usage
auto pool = std::make_shared<kcenon::thread::thread_pool>("my_pool");
static std::shared_ptr< common::interfaces::IExecutor > create_from_thread_pool(std::shared_ptr< kcenon::thread::thread_pool > pool)
Create an IExecutor adapter from a thread_pool.

Definition at line 411 of file common_executor_adapter.h.

Member Function Documentation

◆ create_from_thread_pool()

static std::shared_ptr< common::interfaces::IExecutor > kcenon::thread::adapters::common_executor_factory::create_from_thread_pool ( std::shared_ptr< kcenon::thread::thread_pool > pool)
inlinestatic

Create an IExecutor adapter from a thread_pool.

Parameters
poolThe thread_pool to wrap
Returns
Shared pointer to an IExecutor that delegates to the pool

Definition at line 419 of file common_executor_adapter.h.

420 {
421 return std::make_shared<thread_pool_executor_adapter>(std::move(pool));
422 }

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