NVIDIA(R) PhysX(R) SDK 3.4 API Reference: physx::PxLightCpuTask Class Reference

NVIDIA PhysX API

physx::PxLightCpuTask Class Reference

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

#include <PxTask.h>

Inheritance diagram for physx::PxLightCpuTask:
Collaboration diagram for physx::PxLightCpuTask:

List of all members.


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.
PX_INLINE void setContinuation (PxBaseTask *c)
 Initialize this task and specify the task that will have its ref count decremented on completion.
PX_INLINE PxBaseTaskgetContinuation () const
 Retrieves continuation task.
PX_INLINE void removeReference ()
 Manually decrement this task's reference count. If the reference count reaches zero, the task will be dispatched.
PX_INLINE int32_t 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

PxBaseTaskmCont
 Continuation task, can be NULL.
volatile int32_t mRefCount
 PxTask is dispatched when reaches 0.

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

physx::PxLightCpuTask::PxLightCpuTask (  )  [inline]

virtual physx::PxLightCpuTask::~PxLightCpuTask (  )  [inline, virtual]


Member Function Documentation

PX_INLINE void physx::PxLightCpuTask::addReference (  )  [inline, virtual]

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

Implements physx::PxBaseTask.

References physx::PxBaseTask::mTm.

PX_INLINE PxBaseTask* physx::PxLightCpuTask::getContinuation (  )  const [inline]

Retrieves continuation task.

References mCont.

PX_INLINE int32_t physx::PxLightCpuTask::getReference (  )  const [inline, virtual]

Return the ref-count for this task.

Implements physx::PxBaseTask.

References mRefCount.

PX_INLINE void physx::PxLightCpuTask::release (  )  [inline, virtual]

called by CpuDispatcher after run method has completed

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

Implements physx::PxBaseTask.

References mCont, and physx::PxBaseTask::removeReference().

PX_INLINE void physx::PxLightCpuTask::removeReference (  )  [inline, virtual]

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

Implements physx::PxBaseTask.

References physx::PxBaseTask::mTm.

PX_INLINE void physx::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] c The task to be executed after this task has finished running

References physx::PxBaseTask::addReference(), physx::PxBaseTask::getTaskManager(), mCont, mRefCount, physx::PxBaseTask::mTm, and PX_ASSERT.

PX_INLINE void physx::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] tm The PxTaskManager this task is managed by
[in] c The task to be executed when this task has finished running

References physx::PxBaseTask::addReference(), mCont, mRefCount, physx::PxBaseTask::mTm, and PX_ASSERT.


Friends And Related Function Documentation

friend class PxTaskMgr [friend]

Reimplemented from physx::PxBaseTask.


Member Data Documentation

Continuation task, can be NULL.

Referenced by getContinuation(), release(), and setContinuation().

volatile int32_t physx::PxLightCpuTask::mRefCount [protected]

PxTask is dispatched when reaches 0.

Referenced by getReference(), and setContinuation().


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



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