24 void Init(
uint inMaxJobs);
31 virtual void WaitForJobs(Barrier *inBarrier)
override;
50 virtual void QueueJob(Job *inJob)
override;
51 virtual void QueueJobs(Job **inJobs,
uint inNumJobs)
override;
52 virtual void FreeJob(Job *inJob)
override;
#define JPH_EXPORT
Definition Core.h:236
unsigned int uint
Definition Core.h:446
#define JPH_NAMESPACE_END
Definition Core.h:379
std::uint32_t uint32
Definition Core.h:449
#define JPH_NAMESPACE_BEGIN
Definition Core.h:373
#define JPH_OVERRIDE_NEW_DELETE
Macro to override the new and delete functions.
Definition Memory.h:31
Class that holds an RGBA color with 8-bits per component.
Definition Color.h:16
A job barrier keeps track of a number of jobs and allows waiting until they are all completed.
Definition JobSystem.h:123
Definition JobSystem.h:80
A class that contains information for a single unit of work.
Definition JobSystem.h:171
Definition JobSystem.h:70
virtual JobHandle CreateJob(const char *inName, ColorArg inColor, const JobFunction &inJobFunction, uint32 inNumDependencies=0)=0
virtual Barrier * CreateBarrier()=0
Create a new barrier, used to wait on jobs.
virtual void WaitForJobs(Barrier *inBarrier)=0
Wait for a set of jobs to be finished, note that only 1 thread can be waiting on a barrier at a time.
virtual void DestroyBarrier(Barrier *inBarrier)=0
Destroy a barrier when it is no longer used. The barrier should be empty at this point.
virtual void QueueJobs(Job **inJobs, uint inNumJobs)=0
Adds a number of jobs at once to the job queue.
virtual void FreeJob(Job *inJob)=0
Frees a job.
virtual void QueueJob(Job *inJob)=0
Adds a job to the job queue.
Definition JobSystemSingleThreaded.h:36
virtual void AddJobs(const JobHandle *inHandles, uint inNumHandles) override
Definition JobSystemSingleThreaded.h:42
virtual JPH_OVERRIDE_NEW_DELETE void AddJob(const JobHandle &inJob) override
Definition JobSystemSingleThreaded.h:41
virtual void OnJobFinished(Job *inJob) override
Called by a Job to mark that it is finished.
Definition JobSystemSingleThreaded.h:46
Implementation of a JobSystem without threads, runs jobs as soon as they are added.
Definition JobSystemSingleThreaded.h:14
BarrierImpl mDummyBarrier
Shared barrier since the barrier implementation does nothing.
Definition JobSystemSingleThreaded.h:55
AvailableJobs mJobs
Definition JobSystemSingleThreaded.h:59
virtual int GetMaxConcurrency() const override
Get maximum number of concurrently executing jobs.
Definition JobSystemSingleThreaded.h:27
JobSystemSingleThreaded(uint inMaxJobs)
Definition JobSystemSingleThreaded.h:20
JPH_OVERRIDE_NEW_DELETE JobSystemSingleThreaded()=default
Constructor.