Cogs.Core
Public Member Functions | Public Attributes | List of all members
Cogs::Core::Task Class Reference

Defines a task meant to be placed in a TaskQueue and handled by a TaskWorker instance. More...

Public Member Functions

 Task ()=default
 Default construct a Task.
 

Public Attributes

TaskFunction kernel
 Task kernel, this is the function to run.
 
Taskparent = nullptr
 Pointer to the parent task, nullptr if no parent task exists.
 
Atomic< int > active {0}
 Number of active sub-tasks.
 
TaskFlags flags = TaskFlags::None
 Task flags.
 
std::atomic< uint16_t > generation = 0
 Generation counter, used to identify reallocated tasks.
 
std::atomic< int > continuationCount
 Continuation count.
 
TaskId continuations [5]
 Registered continuations.
 

Detailed Description

Defines a task meant to be placed in a TaskQueue and handled by a TaskWorker instance.

Definition at line 43 of file TaskManager.cpp.

Member Data Documentation

◆ active

Atomic<int> Cogs::Core::Task::active {0}

◆ continuationCount

std::atomic<int> Cogs::Core::Task::continuationCount

Continuation count.

Definition at line 65 of file TaskManager.cpp.

◆ continuations

TaskId Cogs::Core::Task::continuations[5]

Registered continuations.

Definition at line 68 of file TaskManager.cpp.

◆ flags

TaskFlags Cogs::Core::Task::flags = TaskFlags::None

◆ generation

std::atomic<uint16_t> Cogs::Core::Task::generation = 0

Generation counter, used to identify reallocated tasks.

Definition at line 62 of file TaskManager.cpp.

Referenced by Cogs::Core::TaskQueue::createTask(), Cogs::Core::TaskQueue::destroyTask(), Cogs::Core::TaskQueue::enqueue(), and Cogs::Core::TaskQueue::wait().

◆ kernel

TaskFunction Cogs::Core::Task::kernel

Task kernel, this is the function to run.

Definition at line 50 of file TaskManager.cpp.

Referenced by Cogs::Core::TaskQueue::createTask(), Cogs::Core::TaskQueue::enqueueTask(), and Cogs::Core::TaskQueue::workOnTask().

◆ parent

Task* Cogs::Core::Task::parent = nullptr

Pointer to the parent task, nullptr if no parent task exists.

Definition at line 53 of file TaskManager.cpp.

Referenced by Cogs::Core::TaskQueue::createTask(), and Cogs::Core::TaskQueue::finishTask().


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