![]() |
Gaia-ECS v0.9.3
A simple and powerful entity component system
|
Storage and lifecycle manager for internal job and parallel callback records. More...
#include <jobmanager.h>
Public Member Functions | |
| JobContainer & | data (JobHandle jobHandle) |
| Returns mutable internal storage for jobHandle. | |
| const JobContainer & | data (JobHandle jobHandle) const |
| Returns immutable internal storage for jobHandle. | |
| GAIA_NODISCARD JobHandle | alloc_job (Job job) |
| Allocates a new job container identified by a unique JobHandle. | |
| GAIA_NODISCARD ParallelCallbackHandle | alloc_parallel_callback (JobArgsFunc callback, uint32_t refs) |
| Allocates a shared callback record used by parallel jobs. | |
| void | free_job (JobHandle jobHandle) |
| Invalidates jobHandle by resetting its index in the job pool. Every time a job is deallocated its generation is increased by one. | |
| void | free_parallel_callback (ParallelCallbackHandle handle) |
| Releases a shared callback record. | |
| void | reset () |
| Resets the job pool. | |
| void | dep (JobHandle jobFirst, JobHandle jobSecond) |
| Makes jobSecond depend on jobFirst. This means jobSecond will not run until jobFirst finishes. | |
| void | dep (std::span< JobHandle > jobsFirst, JobHandle jobSecond) |
| Makes jobSecond depend on the jobs listed in jobsFirst. This means jobSecond will not run until all jobs from jobsFirst finish. | |
| void | dep_refresh (std::span< JobHandle > jobsFirst, JobHandle jobSecond) |
| Makes jobSecond depend on the jobs listed in jobsFirst. This means jobSecond will not run until all jobs from jobsFirst finish. | |
| GAIA_NODISCARD bool | is_clear (JobHandle jobHandle) const |
| Checks whether the job referenced by jobHandle is in the clear state. | |
| void | invoke_parallel_callback (ParallelCallbackHandle handle, const JobArgs &args) |
| Invokes the shared callback referenced by handle. | |
| GAIA_NODISCARD bool | release_parallel_callback_ref (ParallelCallbackHandle handle) |
| Releases one reference to the callback referenced by handle. | |
Static Public Member Functions | |
| static void | run (JobContainer &jobData) |
| Execute the functor associated with the job container. | |
| static bool | signal_edge (JobContainer &jobData) |
| Signals that one dependency edge of jobData has completed. | |
| static void | free_edges (JobContainer &jobData) |
| Releases heap storage used for the dependency list of jobData. | |
| static uint32_t | submit (JobContainer &jobData) |
| Marks a job as submitted. | |
| static void | processing (JobContainer &jobData) |
| Marks a job as queued for worker processing. | |
| static void | executing (JobContainer &jobData, uint32_t workerIdx) |
| Marks a job as executing on the worker identified by workerIdx. | |
| static void | finalize (JobContainer &jobData) |
| Marks a job as finished. | |
| static void | reset_state (JobContainer &jobData) |
| Resets a completed or never-submitted job back to the clear state. | |
| static GAIA_NODISCARD bool | is_clear (JobContainer &jobData) |
| Checks whether jobData is in the clear state. | |
| static GAIA_NODISCARD bool | submitted (const JobContainer &jobData) |
| Checks whether jobData has been submitted but not yet queued for execution. | |
| static GAIA_NODISCARD bool | processing (const JobContainer &jobData) |
| Checks whether jobData is queued for worker processing. | |
| static GAIA_NODISCARD bool | busy (const JobContainer &jobData) |
| Checks whether jobData currently is executing or queued for execution. | |
| static GAIA_NODISCARD bool | done (const JobContainer &jobData) |
| Checks whether jobData has finished executing. | |
Storage and lifecycle manager for internal job and parallel callback records.
|
inline |
Allocates a shared callback record used by parallel jobs.
| callback | Callback to invoke. |
| refs | Initial reference count. |
|
inlinestatic |
Checks whether jobData currently is executing or queued for execution.
| jobData | Job to inspect. |
|
inline |
Returns mutable internal storage for jobHandle.
| jobHandle | Handle of the job to inspect. |
|
inline |
Returns immutable internal storage for jobHandle.
| jobHandle | Handle of the job to inspect. |
Makes jobSecond depend on jobFirst. This means jobSecond will not run until jobFirst finishes.
| jobFirst | The job that must complete first. |
| jobSecond | The job that will run after jobFirst. |
Makes jobSecond depend on the jobs listed in jobsFirst. This means jobSecond will not run until all jobs from jobsFirst finish.
| jobsFirst | Jobs that must complete first. |
| jobSecond | The job that will run after jobsFirst. |
|
inline |
Makes jobSecond depend on the jobs listed in jobsFirst. This means jobSecond will not run until all jobs from jobsFirst finish.
| jobsFirst | Jobs that must complete first. |
| jobSecond | The job that will run after jobsFirst. |
|
inlinestatic |
Checks whether jobData has finished executing.
| jobData | Job to inspect. |
|
inlinestatic |
Marks a job as executing on the worker identified by workerIdx.
| jobData | Job to transition. |
| workerIdx | Worker executing the job. |
|
inlinestatic |
Marks a job as finished.
| jobData | Job to transition. |
|
inlinestatic |
Releases heap storage used for the dependency list of jobData.
| jobData | Job whose dependency edge storage should be released. |
|
inline |
Invalidates jobHandle by resetting its index in the job pool. Every time a job is deallocated its generation is increased by one.
| jobHandle | Job handle. |
|
inline |
Releases a shared callback record.
| handle | Handle of the callback record to free. |
|
inline |
Invokes the shared callback referenced by handle.
| handle | Callback handle. |
| args | Arguments forwarded to the callback. |
|
inlinestatic |
Checks whether jobData is in the clear state.
| jobData | Job to inspect. |
|
inline |
Checks whether the job referenced by jobHandle is in the clear state.
| jobHandle | Handle of the job to inspect. |
|
inlinestatic |
Checks whether jobData is queued for worker processing.
| jobData | Job to inspect. |
|
inlinestatic |
Marks a job as queued for worker processing.
| jobData | Job to transition. |
|
inline |
Releases one reference to the callback referenced by handle.
| handle | Callback handle. |
|
inlinestatic |
Resets a completed or never-submitted job back to the clear state.
| jobData | Job to reset. |
|
inlinestatic |
Execute the functor associated with the job container.
| jobData | Container with internal job specific data |
|
inlinestatic |
Signals that one dependency edge of jobData has completed.
| jobData | Job whose dependency counter should be decremented. |
|
inlinestatic |
Marks a job as submitted.
| jobData | Job to transition. |
|
inlinestatic |
Checks whether jobData has been submitted but not yet queued for execution.
| jobData | Job to inspect. |