Gaia-ECS v0.9.3
A simple and powerful entity component system
Loading...
Searching...
No Matches
gaia::ecs::Sched Struct Reference

Scheduler descriptor used by ECS runtime code. All callbacks may be null when the descriptor is only used as a placeholder and will be resolved through sched_def(). More...

#include <sched.h>

Public Attributes

void * pCtx = nullptr
 Opaque scheduler-owned context passed back to every callback.
 
SchedToken(* sched )(void *pCtx, const SchedTaskDesc *pDesc) = nullptr
 Schedules one task for execution.
 
SchedToken(* sched_par )(void *pCtx, const SchedParDesc *pDesc) = nullptr
 Schedules a parallel-for workload for execution.
 
SchedToken(* add )(void *pCtx, const SchedTaskDesc *pDesc) = nullptr
 Adds one task without submitting it for execution.
 
SchedToken(* add_par )(void *pCtx, const SchedParDesc *pDesc) = nullptr
 Adds a parallel-for workload without submitting it for execution.
 
void(* submit )(void *pCtx, SchedToken token) = nullptr
 Submits a previously added token.
 
void(* dep )(void *pCtx, SchedToken tokenFirst, SchedToken tokenSecond) = nullptr
 Adds a dependency edge so tokenSecond runs after tokenFirst.
 
void(* wait )(void *pCtx, SchedToken token) = nullptr
 Waits until the scheduled work referenced by token finishes.
 
void(* del )(void *pCtx, SchedToken token) = nullptr
 Deletes any scheduler-owned resources associated with token.
 

Detailed Description

Scheduler descriptor used by ECS runtime code. All callbacks may be null when the descriptor is only used as a placeholder and will be resolved through sched_def().

Member Data Documentation

◆ add

SchedToken(* gaia::ecs::Sched::add) (void *pCtx, const SchedTaskDesc *pDesc) = nullptr

Adds one task without submitting it for execution.

Parameters
pCtxScheduler-owned context.
pDescTask description to add.
Returns
Opaque token for the added task.

◆ add_par

SchedToken(* gaia::ecs::Sched::add_par) (void *pCtx, const SchedParDesc *pDesc) = nullptr

Adds a parallel-for workload without submitting it for execution.

Parameters
pCtxScheduler-owned context.
pDescParallel-for description to add.
Returns
Opaque token for the added workload.

◆ del

void(* gaia::ecs::Sched::del) (void *pCtx, SchedToken token) = nullptr

Deletes any scheduler-owned resources associated with token.

Parameters
pCtxScheduler-owned context.
tokenOpaque synchronization token returned by sched(), sched_par(), add(), or add_par().

◆ dep

void(* gaia::ecs::Sched::dep) (void *pCtx, SchedToken tokenFirst, SchedToken tokenSecond) = nullptr

Adds a dependency edge so tokenSecond runs after tokenFirst.

Parameters
pCtxScheduler-owned context.
tokenFirstWork that must complete first.
tokenSecondWork that depends on tokenFirst.

◆ sched

SchedToken(* gaia::ecs::Sched::sched) (void *pCtx, const SchedTaskDesc *pDesc) = nullptr

Schedules one task for execution.

Parameters
pCtxScheduler-owned context.
pDescTask description to execute.
Returns
Opaque synchronization token for the scheduled work.

◆ sched_par

SchedToken(* gaia::ecs::Sched::sched_par) (void *pCtx, const SchedParDesc *pDesc) = nullptr

Schedules a parallel-for workload for execution.

Parameters
pCtxScheduler-owned context.
pDescParallel-for description to execute.
Returns
Opaque synchronization token for the scheduled work.

◆ submit

void(* gaia::ecs::Sched::submit) (void *pCtx, SchedToken token) = nullptr

Submits a previously added token.

Parameters
pCtxScheduler-owned context.
tokenOpaque token returned by add() or add_par().

◆ wait

void(* gaia::ecs::Sched::wait) (void *pCtx, SchedToken token) = nullptr

Waits until the scheduled work referenced by token finishes.

Parameters
pCtxScheduler-owned context.
tokenOpaque synchronization token returned by sched(), sched_par(), add(), or add_par().

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