Common System 0.2.0
Common interfaces and patterns for system integration
Loading...
Searching...
No Matches
example_executor_provider Class Reference
Inheritance diagram for example_executor_provider:
Inheritance graph
Collaboration diagram for example_executor_provider:
Collaboration graph

Public Member Functions

std::shared_ptr< IExecutorget_executor () override
 Get the default executor instance.
 
std::shared_ptr< IExecutorcreate_executor (size_t worker_count) override
 Create a new executor with specific configuration.
 
- Public Member Functions inherited from kcenon::common::interfaces::IExecutorProvider
virtual ~IExecutorProvider ()=default
 
virtual ~IExecutorProvider ()=default
 

Private Attributes

std::shared_ptr< IExecutordefault_executor_
 

Detailed Description

Example of executor provider pattern

Examples
executor_example.cpp.

Definition at line 282 of file executor_example.cpp.

Member Function Documentation

◆ create_executor()

std::shared_ptr< IExecutor > example_executor_provider::create_executor ( size_t worker_count)
inlineoverridevirtual

Create a new executor with specific configuration.

Parameters
worker_countNumber of worker threads
Returns
Shared pointer to the new executor

Implements kcenon::common::interfaces::IExecutorProvider.

Examples
executor_example.cpp.

Definition at line 291 of file executor_example.cpp.

291 {
292 return std::make_shared<mock_executor>(worker_count);
293 }

Referenced by get_executor().

Here is the caller graph for this function:

◆ get_executor()

std::shared_ptr< IExecutor > example_executor_provider::get_executor ( )
inlineoverridevirtual

Get the default executor instance.

Returns
Shared pointer to the executor

Implements kcenon::common::interfaces::IExecutorProvider.

Examples
executor_example.cpp.

Definition at line 284 of file executor_example.cpp.

284 {
285 if (!default_executor_) {
287 }
288 return default_executor_;
289 }
std::shared_ptr< IExecutor > create_executor(size_t worker_count) override
Create a new executor with specific configuration.
std::shared_ptr< IExecutor > default_executor_

References create_executor(), and default_executor_.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ default_executor_

std::shared_ptr<IExecutor> example_executor_provider::default_executor_
private
Examples
executor_example.cpp.

Definition at line 296 of file executor_example.cpp.

Referenced by get_executor().


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