Public Member Functions | Protected Attributes | Friends | List of all members
PxBaseTask Class Referenceabstract

Base class of all task types. More...

#include <PxTask.h>

Inheritance diagram for PxBaseTask:
Inheritance graph
[legend]
Collaboration diagram for PxBaseTask:
Collaboration graph
[legend]

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 PxI32 getReference () const =0
 Implemented by derived implementation classes. More...
 
virtual void release ()=0
 Implemented by derived implementation classes. More...
 
PX_INLINE void runProfiled (PxU32 threadId=0)
 Execute user run method with wrapping profiling events. More...
 
PX_INLINE void setProfileStat (PxU16 stat)
 Specify stop event statistic. More...
 
PX_INLINE PxTaskManagergetTaskManager () const
 Return PxTaskManager to which this task was submitted. More...
 

Protected Attributes

PxU16 mEventID
 Registered profile event ID. More...
 
PxU16 mProfileStat
 Profiling statistic. 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::PxBaseTask ( )
inline
virtual PxBaseTask::~PxBaseTask ( )
inlinevirtual

Member Function Documentation

virtual void PxBaseTask::addReference ( )
pure virtual

Implemented by derived implementation classes.

Implemented in PxLightCpuTask, and PxTask.

Referenced by PxLightCpuTask::setContinuation().

virtual const char* 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
virtual PxI32 PxBaseTask::getReference ( ) const
pure virtual

Implemented by derived implementation classes.

Implemented in PxLightCpuTask, and PxTask.

PX_INLINE PxTaskManager* 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.

virtual void 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 PxLightCpuTask, PxTask, and PxGpuTask.

virtual void PxBaseTask::removeReference ( )
pure virtual

Implemented by derived implementation classes.

Implemented in PxLightCpuTask, PxTask, and PxSpuTask.

Referenced by PxGpuTask::release().

virtual void 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.

Implemented in PxSpuTask.

PX_INLINE void PxBaseTask::runProfiled ( PxU32  threadId = 0)
inline

Execute user run method with wrapping profiling events.

Optional entry point for use by CpuDispatchers.

Parameters
[in]threadIdThe threadId of the thread that executed the task.
PX_INLINE void PxBaseTask::setProfileStat ( PxU16  stat)
inline

Specify stop event statistic.

If called before or while the task is executing, the given value will appear in the task's event bar in the profile viewer

Parameters
[in]statThe stat to signal when the task is finished

Friends And Related Function Documentation

friend class PxTaskMgr
friend

Member Data Documentation

PxU16 PxBaseTask::mEventID
protected

Registered profile event ID.

PxU16 PxBaseTask::mProfileStat
protected

Profiling statistic.

PxTaskManager* PxBaseTask::mTm
protected

Owning PxTaskManager instance.


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


Copyright © 2008-2015 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com