co_ecs 0.9.0
Cobalt ECS
Loading...
Searching...
No Matches
co_ecs::task_pool Class Reference

Manages a pool of tasks, allocated from a circular array. Tasks are reused instead of being deallocated explicitly. More...

#include <task.hpp>

Static Public Member Functions

static task_tallocate (auto &&func, task_t *parent=nullptr)
 Allocates a task with the specified function and parent, placing it in a circular buffer.
 

Static Public Attributes

static constexpr std::size_t max_tasks = 4096
 Maximum number of tasks that can exist at any given time per worker.
 

Detailed Description

Manages a pool of tasks, allocated from a circular array. Tasks are reused instead of being deallocated explicitly.

Member Function Documentation

◆ allocate()

static task_t * co_ecs::task_pool::allocate ( auto && func,
task_t * parent = nullptr )
inlinestatic

Allocates a task with the specified function and parent, placing it in a circular buffer.

Parameters
funcA callable object to be executed by the task.
parentOptional pointer to a parent task.
Returns
Pointer to the newly allocated task.

Member Data Documentation

◆ max_tasks

constexpr std::size_t co_ecs::task_pool::max_tasks = 4096
staticconstexpr

Maximum number of tasks that can exist at any given time per worker.


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