Jolt Physics
A multi core friendly Game Physics Engine
|
A class that contains information for a single unit of work. More...
#include <JobSystem.h>
Public Member Functions | |
JPH_OVERRIDE_NEW_DELETE | Job (const char *inJobName, ColorArg inColor, JobSystem *inJobSystem, const JobFunction &inJobFunction, uint32 inNumDependencies) |
Constructor. | |
JobSystem * | GetJobSystem () |
Get the jobs system to which this job belongs. | |
void | AddRef () |
Add or release a reference to this object. | |
void | Release () |
void | AddDependency (int inCount) |
Add to the dependency counter. | |
bool | RemoveDependency (int inCount) |
void | RemoveDependencyAndQueue (int inCount) |
bool | SetBarrier (Barrier *inBarrier) |
Set the job barrier that this job belongs to and returns false if this was not possible because the job already finished. | |
uint32 | Execute () |
Run the job function, returns the number of dependencies that this job still has or cExecutingState or cDoneState. | |
bool | CanBeExecuted () const |
Test if the job can be executed. | |
bool | IsDone () const |
Test if the job finished executing. | |
const char * | GetName () const |
Get the name of the job. | |
Static Public Attributes | |
static constexpr uint32 | cExecutingState = 0xe0e0e0e0 |
Value of mNumDependencies when job is executing. | |
static constexpr uint32 | cDoneState = 0xd0d0d0d0 |
Value of mNumDependencies when job is done executing. | |
static constexpr intptr_t | cBarrierDoneState = ~intptr_t(0) |
Value to use when the barrier has been triggered. | |
A class that contains information for a single unit of work.
|
inline |
Constructor.
|
inline |
Add to the dependency counter.
|
inline |
Add or release a reference to this object.
|
inline |
Test if the job can be executed.
|
inline |
Run the job function, returns the number of dependencies that this job still has or cExecutingState or cDoneState.
|
inline |
Get the jobs system to which this job belongs.
|
inline |
Get the name of the job.
|
inline |
Test if the job finished executing.
|
inline |
|
inline |
Remove from the dependency counter. Returns true whenever the dependency counter reaches zero and if it does it is no longer valid to call the AddDependency/RemoveDependency functions.
|
inline |
Remove from the dependency counter. Job will be queued whenever the dependency counter reaches zero and if it does it is no longer valid to call the AddDependency/RemoveDependency functions.
|
inline |
Set the job barrier that this job belongs to and returns false if this was not possible because the job already finished.
|
staticconstexpr |
Value to use when the barrier has been triggered.
|
staticconstexpr |
Value of mNumDependencies when job is done executing.
|
staticconstexpr |
Value of mNumDependencies when job is executing.