PxTask

Defined in include/task/PxTask.h

class PxTask : public PxBaseTask

A PxBaseTask implementation with deferred execution and full dependencies.

A PxTask must be submitted to a PxTaskManager to to be executed, Tasks may optionally be named when they are submitted.

Public Functions

inline PxTask()
inline virtual ~PxTask()
inline virtual void release() override

Release method implementation.

inline void finishBefore(PxTaskID taskID)

Inform the PxTaskManager this task must finish before the given.

inline void startAfter(PxTaskID taskID)

Inform the PxTaskManager this task cannot start until the given.

inline virtual void addReference() override

Manually increment this task’s reference count.

The task will not be allowed to run until removeReference() is called.

inline virtual void removeReference() override

Manually decrement this task’s reference count.

If the reference count reaches zero, the task will be dispatched.

inline virtual int32_t getReference() const override

Return the ref-count for this task.

inline PxTaskID getTaskID() const

Return the unique ID for this task.

inline virtual void submitted()

Called by PxTaskManager at submission time for initialization.

Perform simulation step initialization here.

virtual void run() = 0

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.

virtual const char *getName() const = 0

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

inline PxTaskManager *getTaskManager() const

Return PxTaskManager to which this task was submitted.

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

inline void setContextId(PxU64 id)
inline PxU64 getContextId() const

Protected Attributes

PxTaskID mTaskID

ID assigned at submission.

PxU64 mContextID

Context ID for profiler interface.

PxTaskManager *mTm

Owning PxTaskManager instance.

Friends

friend class PxTaskMgr