igor::iTask Class Referenceabstract

#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
 

Detailed Description

need a task to be done in parallel? than derive from this base class

Constructor & Destructor Documentation

◆ iTask()

igor::iTask::iTask ( iWindowPtr  window = nullptr,
uint32  priority = iTask::TASK_PRIORITY_DEFAULT,
bool  isRepeating = false,
iTaskContext  taskContext = iTaskContext::Default 
)

sets member variables

Parameters
windowoptional parameter only for task using render context
prioritythe priority this task will run
isRepeatingif true the task will be triggered repeadetly
needsRenderContextif true the task needs the render context e.g. to create a texture using the renderer

◆ ~iTask()

virtual igor::iTask::~iTask ( )
virtualdefault

does nothing

Member Function Documentation

◆ abort()

void igor::iTask::abort ( )
virtual

◆ getContext()

iTaskContext igor::iTask::getContext ( )
Returns
context needed for this task

◆ getID()

iTaskID igor::iTask::getID ( )
Returns
ID of task

◆ getPriority()

uint32 igor::iTask::getPriority ( )
Returns
priority of task

◆ getWindow()

iWindowPtr igor::iTask::getWindow ( )
Returns
pointer to window if present

◆ getWorldID()

uint64 igor::iTask::getWorldID ( )
Returns
physics world id if present

◆ isRepeating()

bool igor::iTask::isRepeating ( )
Returns
true: task is a repeating task; false: task will only be run once

◆ isRunning()

bool igor::iTask::isRunning ( )
Returns
true: if task is still running; false: if it has stopped or not started yet

◆ run()

virtual void igor::iTask::run ( )
protectedpure virtual

◆ setPriority()

void igor::iTask::setPriority ( uint32  priority)

sets the task's priority

Parameters
prioritynew priority to set

◆ setRepeating()

void igor::iTask::setRepeating ( bool  repeat)
protected

sets if the task is repeating

Parameters
repeat�f true the task will be repeated

◆ setWorldID()

void igor::iTask::setWorldID ( uint64  worldID)

sets physics world id

Parameters
worldIDthe world id

Friends And Related Function Documentation

◆ iTaskManager

friend class iTaskManager
friend

Member Data Documentation

◆ INVALID_TASK_ID

const iTaskID igor::iTask::INVALID_TASK_ID = 0
static

invalid task id definition

◆ TASK_PRIORITY_DEFAULT

const uint32 igor::iTask::TASK_PRIORITY_DEFAULT = 10
static

default priority for a task to run

◆ TASK_PRIORITY_HIGH

const uint32 igor::iTask::TASK_PRIORITY_HIGH = 5
static

high priority for a task to run

◆ TASK_PRIORITY_LOW

const uint32 igor::iTask::TASK_PRIORITY_LOW = 20
static

low priority for a task to run

◆ TASK_PRIORITY_MAX

const uint32 igor::iTask::TASK_PRIORITY_MAX = 0
static

max priority for a task to run


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