A multi-threaded job system for parallel task execution.
More...
#include <job_system.hpp>
|
| ~JobSystem () |
| Destructor that ensures proper thread cleanup.
|
|
template<typename MyJobFunction, typename... Arguments> |
auto | AddWork (MyJobFunction &&function, Arguments &&... params) -> std::future< decltype(function(params...))> |
| Deleted copy and move constructors/operators to prevent copying or moving.
|
|
| JobSystem () |
| Constructor that initializes worker threads.
|
|
A multi-threaded job system for parallel task execution.
Definition at line 51 of file job_system.hpp.
◆ AddWork()
template<typename MyJobFunction, typename ... Arguments>
auto Raftel::JobSystem::AddWork |
( |
MyJobFunction && | function, |
|
|
Arguments &&... | params ) -> std::future<decltype(function(params...))> |
|
inline |
Deleted copy and move constructors/operators to prevent copying or moving.
Adds a job to the work queue.
This prevents accidental duplication or transfer of JobSystem instances, ensuring that only one instance manages the worker threads.
Adds a job to the work queue.
- Template Parameters
-
MyJobFunction | The type of the callable function. |
Arguments | Variadic template arguments for function parameters. |
- Parameters
-
function | The function to be executed by a worker thread. |
params | Parameters for the function. |
- Returns
- A future object representing the result of the asynchronous job.
- Template Parameters
-
MyJobFunction | The type of the callable function. |
Arguments | Variadic template arguments for function parameters. |
- Parameters
-
function | The function to be executed. |
params | Parameters for the function. |
- Returns
- A future object representing the result of the asynchronous job.
Definition at line 107 of file job_system.hpp.
◆ make()
static std::unique_ptr< JobSystem > Raftel::JobSystem::make |
( |
| ) |
|
|
static |
Factory method to create a JobSystem instance.
- Returns
- A unique pointer to a new JobSystem instance.
The documentation for this class was generated from the following file:
- C:/Users/carlo/OneDrive/Documentos/GitHub/3PVG_PMG_24_mazcunyabla_folgadoba/include/raftel/job_system.hpp