PhysX SDK 3.2 API Reference: pxtask::BaseTask Class Reference

PhysX SDK 3.2 API

pxtask::BaseTask Class Reference

Base class of all task types. More...

#include <PxTask.h>

Inheritance diagram for pxtask::BaseTask:
Collaboration diagram for pxtask::BaseTask:

List of all members.


Public Member Functions

 BaseTask ()
virtual ~BaseTask ()
virtual void run ()=0
 The user-implemented run method where the task's work should be performed.
virtual const char * getName () const =0
 Return a user-provided task name for profiling purposes.
virtual void addReference ()=0
 Implemented by derived implementation classes.
virtual void removeReference ()=0
 Implemented by derived implementation classes.
virtual PxI32 getReference () const =0
 Implemented by derived implementation classes.
virtual void release ()=0
 Implemented by derived implementation classes.
PX_INLINE void runProfiled ()
 Execute user run method with wrapping profiling events.
PX_INLINE void setProfileStat (PxU16 stat)
 Specify stop event statistic.
PX_INLINE TaskManagergetTaskManager () const
 Return TaskManager to which this task was submitted.

Protected Attributes

PxU16 mEventID
 Registered profile event ID.
PxU16 mProfileStat
 Profiling statistic.
TaskManagermTm
 Owning TaskManager instance.

Friends

class TaskMgr

Detailed Description

Base class of all task types.

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


Constructor & Destructor Documentation

pxtask::BaseTask::BaseTask (  )  [inline]

virtual pxtask::BaseTask::~BaseTask (  )  [inline, virtual]


Member Function Documentation

virtual void pxtask::BaseTask::addReference (  )  [pure virtual]

Implemented by derived implementation classes.

Implemented in pxtask::Task, and pxtask::LightCpuTask.

Referenced by pxtask::LightCpuTask::setContinuation().

virtual const char* pxtask::BaseTask::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 pxtask::BaseTask::getReference (  )  const [pure virtual]

Implemented by derived implementation classes.

Implemented in pxtask::Task, and pxtask::LightCpuTask.

PX_INLINE TaskManager* pxtask::BaseTask::getTaskManager (  )  const [inline]

Return TaskManager to which this task was submitted.

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

virtual void pxtask::BaseTask::release (  )  [pure virtual]

Implemented by derived implementation classes.

Implemented in pxtask::GpuTask, pxtask::Task, and pxtask::LightCpuTask.

virtual void pxtask::BaseTask::removeReference (  )  [pure virtual]

Implemented by derived implementation classes.

Implemented in pxtask::SpuTask, pxtask::Task, and pxtask::LightCpuTask.

Referenced by pxtask::GpuTask::release().

virtual void pxtask::BaseTask::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 pxtask::SpuTask.

PX_INLINE void pxtask::BaseTask::runProfiled (  )  [inline]

Execute user run method with wrapping profiling events.

Optional entry point for use by CpuDispatchers.

PX_INLINE void pxtask::BaseTask::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] stat The stat to signal when the task is finished


Friends And Related Function Documentation

friend class TaskMgr [friend]

Reimplemented in pxtask::Task, and pxtask::LightCpuTask.


Member Data Documentation

Registered profile event ID.

Profiling statistic.

Owning TaskManager instance.


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



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