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

PhysX SDK 3.2 API

pxtask::LightCpuTask Class Reference

A BaseTask implementation with immediate execution and simple dependencies. More...

#include <PxTask.h>

Inheritance diagram for pxtask::LightCpuTask:
Collaboration diagram for pxtask::LightCpuTask:

List of all members.


Public Member Functions

 LightCpuTask ()
virtual ~LightCpuTask ()
PX_INLINE void setContinuation (TaskManager &tm, BaseTask *c)
 Initialize this task and specify the task that will have it's ref count decremented on completion.
PX_INLINE void setContinuation (BaseTask *c)
 Initialize this task and specify the task that will have it's ref count decremented on completion.
PX_INLINE void removeReference ()
 Manually decrement this task's reference count. If the reference count reaches zero, the task will be dispatched.
PX_INLINE PxI32 getReference () const
 Return the ref-count for this task.
PX_INLINE void addReference ()
 Manually increment this task's reference count. The task will not be allowed to run until removeReference() is called.
PX_INLINE void release ()
 called by CpuDispatcher after run method has completed

Protected Attributes

BaseTaskmCont
 Continuation task, can be NULL.
volatile PxI32 mRefCount
 Task is dispatched when reaches 0.

Friends

class TaskMgr

Detailed Description

A BaseTask implementation with immediate execution and simple dependencies.

A LightCpuTask bypasses the TaskManager launch dependencies and will be submitted directly to your scene's CpuDispatcher. When the run() function completes, it will decrement the reference count of the specified continuation task.

You must use a full-blown pxtask::Task if you want your task to be resolved by another pxtask::Task, or you need more than a single dependency to be resolved when your task completes, or your task will not run on the CpuDispatcher.


Constructor & Destructor Documentation

pxtask::LightCpuTask::LightCpuTask (  )  [inline]

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

References NULL.


Member Function Documentation

PX_INLINE void pxtask::LightCpuTask::addReference (  )  [inline, virtual]

Manually increment this task's reference count. The task will not be allowed to run until removeReference() is called.

Implements pxtask::BaseTask.

PX_INLINE PxI32 pxtask::LightCpuTask::getReference (  )  const [inline, virtual]

Return the ref-count for this task.

Implements pxtask::BaseTask.

PX_INLINE void pxtask::LightCpuTask::release (  )  [inline, virtual]

called by CpuDispatcher after run method has completed

Decrements the continuation task's reference count, if specified.

Implements pxtask::BaseTask.

PX_INLINE void pxtask::LightCpuTask::removeReference (  )  [inline, virtual]

Manually decrement this task's reference count. If the reference count reaches zero, the task will be dispatched.

Implements pxtask::BaseTask.

Reimplemented in pxtask::SpuTask.

PX_INLINE void pxtask::LightCpuTask::setContinuation ( BaseTask c  )  [inline]

Initialize this task and specify the task that will have it's ref count decremented on completion.

This overload of setContinuation() queries the TaskManager from the continuation task, which cannot be NULL.

Parameters:
[in] c The task to be executed after this task has finished running

References pxtask::BaseTask::addReference(), and PX_ASSERT.

PX_INLINE void pxtask::LightCpuTask::setContinuation ( TaskManager tm,
BaseTask c 
) [inline]

Initialize this task and specify the task that will have it's ref count decremented on completion.

Submission is deferred until the task's mRefCount is decremented to zero. Note that we only use the TaskManager to query the appropriate dispatcher.

Parameters:
[in] tm The TaskManager this task is managed by
[in] c The task to be executed when this task has finished running

References PX_ASSERT.


Friends And Related Function Documentation

friend class TaskMgr [friend]

Reimplemented from pxtask::BaseTask.


Member Data Documentation

Continuation task, can be NULL.

volatile PxI32 pxtask::LightCpuTask::mRefCount [protected]

Task is dispatched when reaches 0.


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