Move-only wrapper for scheduler-owned ECS work.
More...
#include <sched.h>
|
|
| SchedJob ()=default |
| | Creates an empty wrapper.
|
| |
| | SchedJob (Sched sched, SchedToken token, bool submitted, void *pCleanupCtx, void(*cleanup)(void *pCtx)) |
| | Creates a wrapper around token from sched.
|
| |
|
| ~SchedJob () |
| | Waits for and deletes a still-owned token.
|
| |
|
| SchedJob (const SchedJob &)=delete |
| |
|
SchedJob & | operator= (const SchedJob &)=delete |
| |
| | SchedJob (SchedJob &&other) noexcept |
| | Move-constructs a scheduler job wrapper.
|
| |
| SchedJob & | operator= (SchedJob &&other) noexcept |
| | Move-assigns a scheduler job wrapper.
|
| |
| GAIA_NODISCARD bool | valid () const |
| | Returns true if this wrapper owns scheduler work.
|
| |
| GAIA_NODISCARD SchedToken | token () const |
| | Returns the opaque scheduler token.
|
| |
|
void | submit () |
| | Submits the added work if it has not been submitted yet.
|
| |
| void | dep (const SchedJob &jobFirst) |
| | Adds a dependency edge so this job runs after jobFirst.
|
| |
| void | wait () |
| | Waits for submitted work to complete.
|
| |
|
void | del () |
| | Deletes scheduler resources and runs wrapper cleanup.
|
| |
Move-only wrapper for scheduler-owned ECS work.
SchedJob keeps the scheduler token together with the scheduler callbacks needed to submit, wait for, and delete the work. Query/system deferred execution uses this wrapper instead of exposing gaia::mt::JobHandle directly so external job systems can provide their own token type.
◆ SchedJob() [1/2]
| gaia::ecs::SchedJob::SchedJob |
( |
Sched |
sched, |
|
|
SchedToken |
token, |
|
|
bool |
submitted, |
|
|
void * |
pCleanupCtx, |
|
|
void(*)(void *pCtx) |
cleanup |
|
) |
| |
|
inline |
Creates a wrapper around token from sched.
- Parameters
-
| sched | Scheduler descriptor that created token. |
| token | Scheduler-owned work token. |
| submitted | True if the scheduler already submitted token. |
| pCleanupCtx | Optional cleanup context owned by the wrapper. |
| cleanup | Optional cleanup callback executed after the job is waited or deleted unsubmitted. |
◆ SchedJob() [2/2]
| gaia::ecs::SchedJob::SchedJob |
( |
SchedJob && |
other | ) |
|
|
inlinenoexcept |
Move-constructs a scheduler job wrapper.
- Parameters
-
| other | Wrapper to move from. |
◆ dep()
| void gaia::ecs::SchedJob::dep |
( |
const SchedJob & |
jobFirst | ) |
|
|
inline |
Adds a dependency edge so this job runs after jobFirst.
This member form mirrors the Gaia scheduler naming used by mt::ThreadPool::dep() and sched_dep(). It is equivalent to calling sched_dep() with jobFirst as the prerequisite and this job as the dependent work.
- Parameters
-
| jobFirst | Job that must complete before this job can run. |
- Warning
- Both jobs must use the same scheduler descriptor, and dependencies must be added before either job is submitted.
- See also
- sched_dep()
-
mt::ThreadPool::dep()
◆ operator=()
Move-assigns a scheduler job wrapper.
- Parameters
-
| other | Wrapper to move from. |
- Returns
- Self reference.
◆ token()
| GAIA_NODISCARD SchedToken gaia::ecs::SchedJob::token |
( |
| ) |
const |
|
inline |
Returns the opaque scheduler token.
- Returns
- Token owned by this wrapper.
◆ valid()
| GAIA_NODISCARD bool gaia::ecs::SchedJob::valid |
( |
| ) |
const |
|
inline |
Returns true if this wrapper owns scheduler work.
- Returns
- True when a scheduler token is owned by the wrapper.
◆ wait()
| void gaia::ecs::SchedJob::wait |
( |
| ) |
|
|
inline |
Waits for submitted work to complete.
- Warning
- Waiting does not submit deferred work. Call submit() first.
The documentation for this class was generated from the following file:
- /home/runner/work/gaia-ecs/gaia-ecs/include/gaia/ecs/sched.h