physx::PxBaseTask Class Referenceabstract

Base class of all task types. More...

#include <PxTask.h>

Inheritance diagram for physx::PxBaseTask:
Collaboration diagram for physx::PxBaseTask:

Public Member Functions

 PxBaseTask ()
 
virtual ~PxBaseTask ()
 
virtual void run ()=0
 The user-implemented run method where the task's work should be performed. More...
 
virtual const char * getName () const =0
 Return a user-provided task name for profiling purposes. More...
 
virtual void addReference ()=0
 Implemented by derived implementation classes. More...
 
virtual void removeReference ()=0
 Implemented by derived implementation classes. More...
 
virtual int32_t getReference () const =0
 Implemented by derived implementation classes. More...
 
virtual void release ()=0
 Implemented by derived implementation classes. More...
 
PX_FORCE_INLINE PxTaskManagergetTaskManager () const
 Return PxTaskManager to which this task was submitted. More...
 
PX_FORCE_INLINE void setContextId (PxU64 id)
 
PX_FORCE_INLINE PxU64 getContextId () const
 

Protected Attributes

PxU64 mContextID
 Context ID for profiler interface. More...
 
PxTaskManagermTm
 Owning PxTaskManager instance. More...
 

Friends

class PxTaskMgr
 

Detailed Description

Base class of all task types.

PxBaseTask defines a runnable reference counted task with built-in profiling.

Constructor & Destructor Documentation

◆ PxBaseTask()

physx::PxBaseTask::PxBaseTask ( )
inline

◆ ~PxBaseTask()

virtual physx::PxBaseTask::~PxBaseTask ( )
inlinevirtual

Member Function Documentation

◆ addReference()

virtual void physx::PxBaseTask::addReference ( )
pure virtual

Implemented by derived implementation classes.

Implemented in physx::PxLightCpuTask, and physx::PxTask.

Referenced by physx::PxLightCpuTask::setContinuation().

◆ getContextId()

PX_FORCE_INLINE PxU64 physx::PxBaseTask::getContextId ( ) const
inline

References mContextID.

◆ getName()

virtual const char* physx::PxBaseTask::getName ( ) const
pure virtual

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

◆ getReference()

virtual int32_t physx::PxBaseTask::getReference ( ) const
pure virtual

Implemented by derived implementation classes.

Implemented in physx::PxLightCpuTask, and physx::PxTask.

◆ getTaskManager()

PX_FORCE_INLINE PxTaskManager* physx::PxBaseTask::getTaskManager ( ) const
inline

Return PxTaskManager to which this task was submitted.

Note, can return NULL if task was not submitted, or has been completed.

References mTm.

Referenced by physx::PxLightCpuTask::setContinuation().

◆ release()

virtual void physx::PxBaseTask::release ( )
pure virtual

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

Implemented in physx::PxLightCpuTask, physx::PxTask, and physx::PxGpuTask.

◆ removeReference()

virtual void physx::PxBaseTask::removeReference ( )
pure virtual

Implemented by derived implementation classes.

Implemented in physx::PxLightCpuTask, and physx::PxTask.

Referenced by physx::PxGpuTask::release(), and physx::PxLightCpuTask::release().

◆ run()

virtual void physx::PxBaseTask::run ( )
pure virtual

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.

◆ setContextId()

PX_FORCE_INLINE void physx::PxBaseTask::setContextId ( PxU64  id)
inline

References mContextID.

Friends And Related Function Documentation

◆ PxTaskMgr

friend class PxTaskMgr
friend

Member Data Documentation

◆ mContextID

PxU64 physx::PxBaseTask::mContextID
protected

Context ID for profiler interface.

Referenced by getContextId(), and setContextId().

◆ mTm


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