Public Member Functions | Protected Attributes | Friends | List of all members
PxLightCpuTask Class Reference

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

#include <PxTask.h>

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

Public Member Functions

 PxLightCpuTask ()
 
virtual ~PxLightCpuTask ()
 
PX_INLINE void setContinuation (PxTaskManager &tm, PxBaseTask *c)
 Initialize this task and specify the task that will have its ref count decremented on completion. More...
 
PX_INLINE void setContinuation (PxBaseTask *c)
 Initialize this task and specify the task that will have its ref count decremented on completion. More...
 
PX_INLINE PxBaseTaskgetContinuation () const
 Retrieves continuation task. More...
 
PX_INLINE void removeReference ()
 Manually decrement this task's reference count. If the reference count reaches zero, the task will be dispatched. More...
 
PX_INLINE PxI32 getReference () const
 Return the ref-count for this task. More...
 
PX_INLINE void addReference ()
 Manually increment this task's reference count. The task will not be allowed to run until removeReference() is called. More...
 
PX_INLINE void release ()
 called by CpuDispatcher after run method has completed More...
 
- Public Member Functions inherited from PxBaseTask
 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...
 
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

PxBaseTaskmCont
 Continuation task, can be NULL. More...
 
volatile PxI32 mRefCount
 PxTask is dispatched when reaches 0. More...
 
- Protected Attributes inherited from PxBaseTask
PxU16 mEventID
 Registered profile event ID. More...
 
PxU16 mProfileStat
 Profiling statistic. More...
 
PxTaskManagermTm
 Owning PxTaskManager instance. More...
 

Friends

class PxTaskMgr
 

Detailed Description

A PxBaseTask implementation with immediate execution and simple dependencies.

A PxLightCpuTask bypasses the PxTaskManager 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 if you want your task to be resolved by another PxTask, 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

PxLightCpuTask::PxLightCpuTask ( )
inline
virtual PxLightCpuTask::~PxLightCpuTask ( )
inlinevirtual

References NULL.

Member Function Documentation

PX_INLINE void PxLightCpuTask::addReference ( )
inlinevirtual

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

Implements PxBaseTask.

PX_INLINE PxBaseTask* PxLightCpuTask::getContinuation ( ) const
inline

Retrieves continuation task.

PX_INLINE PxI32 PxLightCpuTask::getReference ( ) const
inlinevirtual

Return the ref-count for this task.

Implements PxBaseTask.

PX_INLINE void PxLightCpuTask::release ( )
inlinevirtual

called by CpuDispatcher after run method has completed

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

Implements PxBaseTask.

PX_INLINE void PxLightCpuTask::removeReference ( )
inlinevirtual

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

Implements PxBaseTask.

PX_INLINE void PxLightCpuTask::setContinuation ( PxTaskManager tm,
PxBaseTask c 
)
inline

Initialize this task and specify the task that will have its ref count decremented on completion.

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

Parameters
[in]tmThe PxTaskManager this task is managed by
[in]cThe task to be executed when this task has finished running

References PX_ASSERT.

PX_INLINE void PxLightCpuTask::setContinuation ( PxBaseTask c)
inline

Initialize this task and specify the task that will have its ref count decremented on completion.

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

Parameters
[in]cThe task to be executed after this task has finished running

References PxBaseTask::addReference(), and PX_ASSERT.

Friends And Related Function Documentation

friend class PxTaskMgr
friend

Member Data Documentation

PxBaseTask* PxLightCpuTask::mCont
protected

Continuation task, can be NULL.

volatile PxI32 PxLightCpuTask::mRefCount
protected

PxTask is dispatched when reaches 0.


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