PxBaseTask
Defined in include/task/PxTask.h
-
class PxBaseTask
Base class of all task types.
PxBaseTask defines a runnable reference counted task with built-in profiling.
Subclassed by PxLightCpuTask, PxTask
Public Functions
-
inline PxBaseTask()
-
inline virtual ~PxBaseTask()
-
virtual void run() = 0
The user-implemented run method where the task’s work should be performed.
run() methods must be thread safe, stack friendly (no alloca, etc), and must never block.
-
virtual const char *getName() const = 0
Return a user-provided task name for profiling purposes.
It does not have to be unique, but unique names are helpful.
- Returns
The name of this task
-
virtual void addReference() = 0
Implemented by derived implementation classes.
-
virtual void removeReference() = 0
Implemented by derived implementation classes.
-
virtual int32_t getReference() const = 0
Implemented by derived implementation classes.
-
virtual void release() = 0
Implemented by derived implementation classes.
A task may assume in its release() method that the task system no longer holds references to it - so it may safely run its destructor, recycle itself, etc. provided no additional user references to the task exist
-
inline PxTaskManager *getTaskManager() const
Return PxTaskManager to which this task was submitted.
Note, can return NULL if task was not submitted, or has been completed.
Protected Attributes
-
PxTaskManager *mTm
Owning PxTaskManager instance.
Friends
- friend class PxTaskMgr
-
inline PxBaseTask()