Open 3D Engine AzCore API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::MultipleDependentJob Class Reference

#include <MultipleDependentJob.h>

Inherits AZ::Job.

Public Member Functions

 AZ_CLASS_ALLOCATOR (MultipleDependentJob, ThreadPoolAllocator)
 
 MultipleDependentJob (bool isAutoDelete, JobContext *context=NULL)
 
void AddDependent (Job *dependent)
 
virtual void Reset (bool isClearDependent)
 
virtual void Process ()
 
- Public Member Functions inherited from AZ::Job
 Job (bool isAutoDelete, JobContext *context, bool isCompletion=false, AZ::s8 priority=0)
 
void Start ()
 
virtual void Reset (bool isClearDependent)
 
void SetDependent (Job *dependent)
 
void SetDependentStarted (Job *dependent)
 
void SetContinuation (Job *continuationJob)
 
void StartAsChild (Job *childJob)
 
void WaitForChildren ()
 
bool IsCancelled () const
 
bool IsAutoDelete () const
 
bool IsCompletion () const
 
void StartAndAssistUntilComplete ()
 
void StartAndWaitForCompletion ()
 
JobContextGetContext () const
 
JobGetDependent () const
 
unsigned int GetDependentCount () const
 
void IncrementDependentCount ()
 
void DecrementDependentCount ()
 
AZ::s8 GetPriority () const
 

Additional Inherited Members

- Public Types inherited from AZ::Job
enum  State {
  STATE_SETUP , STATE_STARTED , STATE_PENDING , STATE_PROCESSING ,
  STATE_SUSPENDED
}
 
- Protected Member Functions inherited from AZ::Job
virtual void Process ()=0
 Override to implement your processing.
 
void StoreDependent (Job *job)
 
void SetDependentChild (Job *dependent)
 
void IncrementDependentCountAndSetChildFlag ()
 
void SetDependentCountAndFlags (unsigned int countAndFlags)
 
unsigned int GetDependentCountAndFlags () const
 
- Protected Attributes inherited from AZ::Job
JobContext *volatile m_context
 
AZStd::atomic< unsigned int > m_dependentCountAndFlags
 
AZStd::atomic< Job * > m_dependent
 
int m_state
 

Detailed Description

A job which maintains a list of dependent jobs, for the situations where having a single dependent or forking new jobs is not sufficient. Note that these situations should be rare, for example a many-to-many dependency tree. This class may be used stand-alone or derived from, if it is derived from make sure the derived Process function calls MultipleDependentJob::Process when it finishes.

Member Function Documentation

◆ AddDependent()

void AZ::MultipleDependentJob::AddDependent ( Job dependent)
inline

Adds a new job which is dependent on this one, the dependent will not be allowed to run until this job is complete.

◆ Process()

void AZ::MultipleDependentJob::Process ( )
inlinevirtual

Make sure to call this at the end of a derived Process function!

Implements AZ::Job.

◆ Reset()

void AZ::MultipleDependentJob::Reset ( bool  isClearDependent)
inlinevirtual

Resets a non-auto deleting job. The dependent list will not be cleared, and will have their dependency counters incremented, so they must be reset first before resetting this job.

Reimplemented from AZ::Job.


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