Represents a task that can be executed, monitored for completion, and linked to a parent task.
More...
#include <task.hpp>
|
| | task_t ()=default |
| | Constructs an empty task.
|
| |
| | task_t (auto &&func, task_t *parent=nullptr) |
| | Constructs a task from a callable function and optionally links it to a parent task.
|
| |
| void | execute () |
| | Executes the task's function and marks it as completed.
|
| |
| bool | is_completed () const noexcept |
| | Checks if the task has been completed.
|
| |
| task_t * | parent () const noexcept |
| | Retrieves the parent task if it exists.
|
| |
Represents a task that can be executed, monitored for completion, and linked to a parent task.
◆ task_t() [1/2]
| co_ecs::task_t::task_t |
( |
| ) |
|
|
default |
Constructs an empty task.
◆ task_t() [2/2]
| co_ecs::task_t::task_t |
( |
auto && | func, |
|
|
task_t * | parent = nullptr ) |
|
inline |
Constructs a task from a callable function and optionally links it to a parent task.
- Parameters
-
| func | A callable object to be executed as the task. |
| parent | Optional pointer to a parent task, defaults to nullptr if no parent is specified. |
◆ execute()
| void co_ecs::task_t::execute |
( |
| ) |
|
|
inline |
Executes the task's function and marks it as completed.
◆ is_completed()
| bool co_ecs::task_t::is_completed |
( |
| ) |
const |
|
inlinenoexcept |
Checks if the task has been completed.
- Returns
- True if the task is completed, otherwise false.
◆ parent()
| task_t * co_ecs::task_t::parent |
( |
| ) |
const |
|
inlinenoexcept |
Retrieves the parent task if it exists.
- Returns
- Pointer to the parent task, or nullptr if there is no parent.
The documentation for this class was generated from the following file: