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

#include <JobSystem.h>

Inheritance diagram for JobSystem::JobHandle:
Ref< Job >

Public Member Functions

 JobHandle ()=default
 Constructor.
 
 JobHandle (const JobHandle &inHandle)=default
 
 JobHandle (JobHandle &&inHandle) noexcept
 
 JobHandle (Job *inJob)
 Constructor, only to be used by JobSystem.
 
JobHandleoperator= (const JobHandle &inHandle)=default
 Assignment.
 
JobHandleoperator= (JobHandle &&inHandle) noexcept=default
 
bool IsValid () const
 Check if this handle contains a job.
 
bool IsDone () const
 Check if this job has finished executing.
 
void AddDependency (int inCount=1) const
 Add to the dependency counter.
 
void RemoveDependency (int inCount=1) const
 

Static Public Member Functions

static void sRemoveDependencies (const JobHandle *inHandles, uint inNumHandles, int inCount=1)
 Remove a dependency from a batch of jobs at once, this can be more efficient than removing them one by one as it requires less locking.
 
template<uint N>
static void sRemoveDependencies (StaticArray< JobHandle, N > &inHandles, int inCount=1)
 Helper function to remove dependencies on a static array of job handles.
 

Detailed Description

A job handle contains a reference to a job. The job will be deleted as soon as there are no JobHandles. referring to the job and when it is not in the job queue / being processed.

Constructor & Destructor Documentation

◆ JobHandle() [1/4]

JobSystem::JobHandle::JobHandle ( )
inlinedefault

Constructor.

◆ JobHandle() [2/4]

JobSystem::JobHandle::JobHandle ( const JobHandle inHandle)
inlinedefault

◆ JobHandle() [3/4]

JobSystem::JobHandle::JobHandle ( JobHandle &&  inHandle)
inlinenoexcept

◆ JobHandle() [4/4]

JobSystem::JobHandle::JobHandle ( Job inJob)
inlineexplicit

Constructor, only to be used by JobSystem.

Member Function Documentation

◆ AddDependency()

void JobSystem::JobHandle::AddDependency ( int  inCount = 1) const
inline

Add to the dependency counter.

◆ IsDone()

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

Check if this job has finished executing.

◆ IsValid()

bool JobSystem::JobHandle::IsValid ( ) const
inline

Check if this handle contains a job.

◆ operator=() [1/2]

JobHandle & JobSystem::JobHandle::operator= ( const JobHandle inHandle)
inlinedefault

Assignment.

◆ operator=() [2/2]

JobHandle & JobSystem::JobHandle::operator= ( JobHandle &&  inHandle)
inlinedefaultnoexcept

◆ RemoveDependency()

void JobSystem::JobHandle::RemoveDependency ( int  inCount = 1) const
inline

Remove from the dependency counter. Job will start whenever the dependency counter reaches zero and if it does it is no longer valid to call the AddDependency/RemoveDependency functions.

◆ sRemoveDependencies() [1/2]

void JobSystem::JobHandle::sRemoveDependencies ( const JobHandle inHandles,
uint  inNumHandles,
int  inCount = 1 
)
inlinestatic

Remove a dependency from a batch of jobs at once, this can be more efficient than removing them one by one as it requires less locking.

◆ sRemoveDependencies() [2/2]

template<uint N>
static void JobSystem::JobHandle::sRemoveDependencies ( StaticArray< JobHandle, N > &  inHandles,
int  inCount = 1 
)
inlinestatic

Helper function to remove dependencies on a static array of job handles.


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