Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
JobSystem::Job Class Reference

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. More...
 
JobSystemGetJobSystem ()
 Get the jobs system to which this job belongs. More...
 
void AddRef ()
 Add or release a reference to this object. More...
 
void Release ()
 
void AddDependency (int inCount)
 Add to the dependency counter. More...
 
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. More...
 
uint32 Execute ()
 Run the job function, returns the number of dependencies that this job still has or cExecutingState or cDoneState. More...
 
bool CanBeExecuted () const
 Test if the job can be executed. More...
 
bool IsDone () const
 Test if the job finished executing. More...
 
const char * GetName () const
 Get the name of the job. More...
 

Static Public Attributes

static constexpr uint32 cExecutingState = 0xe0e0e0e0
 Value of mNumDependencies when job is executing. More...
 
static constexpr uint32 cDoneState = 0xd0d0d0d0
 Value of mNumDependencies when job is done executing. More...
 
static constexpr intptr_t cBarrierDoneState = ~intptr_t(0)
 Value to use when the barrier has been triggered. More...
 

Detailed Description

A class that contains information for a single unit of work.

Constructor & Destructor Documentation

◆ Job()

JPH_OVERRIDE_NEW_DELETE JobSystem::Job::Job ( const char *  inJobName,
ColorArg  inColor,
JobSystem inJobSystem,
const JobFunction inJobFunction,
uint32  inNumDependencies 
)
inline

Constructor.

Member Function Documentation

◆ AddDependency()

JPH_NAMESPACE_BEGIN void JobSystem::Job::AddDependency ( int  inCount)
inline

Add to the dependency counter.

◆ AddRef()

void JobSystem::Job::AddRef ( )
inline

Add or release a reference to this object.

◆ CanBeExecuted()

bool JobSystem::Job::CanBeExecuted ( ) const
inline

Test if the job can be executed.

◆ Execute()

uint32 JobSystem::Job::Execute ( )
inline

Run the job function, returns the number of dependencies that this job still has or cExecutingState or cDoneState.

◆ GetJobSystem()

JobSystem * JobSystem::Job::GetJobSystem ( )
inline

Get the jobs system to which this job belongs.

◆ GetName()

const char * JobSystem::Job::GetName ( ) const
inline

Get the name of the job.

◆ IsDone()

bool JobSystem::Job::IsDone ( ) const
inline

Test if the job finished executing.

◆ Release()

void JobSystem::Job::Release ( )
inline

◆ RemoveDependency()

bool JobSystem::Job::RemoveDependency ( int  inCount)
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.

◆ RemoveDependencyAndQueue()

void JobSystem::Job::RemoveDependencyAndQueue ( int  inCount)
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.

◆ SetBarrier()

bool JobSystem::Job::SetBarrier ( Barrier inBarrier)
inline

Set the job barrier that this job belongs to and returns false if this was not possible because the job already finished.

Member Data Documentation

◆ cBarrierDoneState

constexpr intptr_t JobSystem::Job::cBarrierDoneState = ~intptr_t(0)
staticconstexpr

Value to use when the barrier has been triggered.

◆ cDoneState

constexpr uint32 JobSystem::Job::cDoneState = 0xd0d0d0d0
staticconstexpr

Value of mNumDependencies when job is done executing.

◆ cExecutingState

constexpr uint32 JobSystem::Job::cExecutingState = 0xe0e0e0e0
staticconstexpr

Value of mNumDependencies when job is executing.


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