0.44.0
|
#include <iTask.h>
Inherited by igor::iTaskFlushResources, igor::iTaskGenerateThumbnails, igor::iTaskGenerateVoxels, igor::iTaskPrepareCollision, igor::iTaskPropsOnVoxels, and igor::iTaskVoxelTerrain.
Public Member Functions | |
iTask (iWindowPtr window=nullptr, uint32 priority=iTask::TASK_PRIORITY_DEFAULT, bool isRepeating=false, iTaskContext taskContext=iTaskContext::Default) | |
virtual | ~iTask ()=default |
virtual void | abort () |
bool | isRunning () |
iTaskContext | getContext () |
uint32 | getPriority () |
void | setPriority (uint32 priority) |
bool | isRepeating () |
iTaskID | getID () |
uint64 | getWorldID () |
void | setWorldID (uint64 worldID) |
iWindowPtr | getWindow () |
Static Public Attributes | |
static const iTaskID | INVALID_TASK_ID = 0 |
static const uint32 | TASK_PRIORITY_MAX = 0 |
static const uint32 | TASK_PRIORITY_HIGH = 5 |
static const uint32 | TASK_PRIORITY_DEFAULT = 10 |
static const uint32 | TASK_PRIORITY_LOW = 20 |
Protected Member Functions | |
void | setRepeating (bool repeat) |
virtual void | run ()=0 |
Friends | |
class | iTaskManager |
need a task to be done in parallel? than derive from this base class
igor::iTask::iTask | ( | iWindowPtr | window = nullptr , |
uint32 | priority = iTask::TASK_PRIORITY_DEFAULT , |
||
bool | isRepeating = false , |
||
iTaskContext | taskContext = iTaskContext::Default |
||
) |
sets member variables
window | optional parameter only for task using render context |
priority | the priority this task will run |
isRepeating | if true the task will be triggered repeadetly |
needsRenderContext | if true the task needs the render context e.g. to create a texture using the renderer |
|
virtualdefault |
does nothing
|
virtual |
aborts the task
Reimplemented in igor::iTaskVoxelTerrain, igor::iTaskFlushResources, and igor::iTaskGenerateThumbnails.
iTaskContext igor::iTask::getContext | ( | ) |
iTaskID igor::iTask::getID | ( | ) |
uint32 igor::iTask::getPriority | ( | ) |
iWindowPtr igor::iTask::getWindow | ( | ) |
uint64 igor::iTask::getWorldID | ( | ) |
bool igor::iTask::isRepeating | ( | ) |
bool igor::iTask::isRunning | ( | ) |
|
protectedpure virtual |
runs the actual task
Implemented in igor::iTaskGenerateVoxels, igor::iTaskPropsOnVoxels, igor::iTaskVoxelTerrain, igor::iTaskFlushResources, and igor::iTaskGenerateThumbnails.
void igor::iTask::setPriority | ( | uint32 | priority | ) |
sets the task's priority
priority | new priority to set |
|
protected |
sets if the task is repeating
repeat | �f true the task will be repeated |
void igor::iTask::setWorldID | ( | uint64 | worldID | ) |
sets physics world id
worldID | the world id |
|
friend |
|
static |
invalid task id definition
|
static |
default priority for a task to run
|
static |
high priority for a task to run
|
static |
low priority for a task to run
|
static |
max priority for a task to run