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

Internal storage for a scheduled job and its dependency metadata. More...

#include <jobmanager.h>

+ Inheritance diagram for gaia::mt::JobContainer:

Public Member Functions

 JobContainer (const JobContainer &other)=delete
 
JobContaineroperator= (const JobContainer &other)=delete
 
 JobContainer (JobContainer &&other)
 
JobContaineroperator= (JobContainer &&other)
 
- Public Member Functions inherited from gaia::cnt::ilist_item
 ilist_item (uint32_t index, uint32_t generation)
 
 ilist_item (const ilist_item &other)
 
ilist_itemoperator= (const ilist_item &other)
 
 ilist_item (ilist_item &&other)
 
ilist_itemoperator= (ilist_item &&other)
 

Static Public Member Functions

static GAIA_NODISCARD JobContainer create (uint32_t index, uint32_t generation, void *pCtx)
 Creates a new job container for the intrusive storage.
 
static GAIA_NODISCARD JobHandle handle (const JobContainer &jc)
 Returns the public handle associated with jc.
 

Public Attributes

std::atomic_uint32_t state
 Current state of the job Consist of upper and bottom part. Least significant bits = special purpose. Most significant bits = state. JobCore states: x | edge count Submitted | edge count, must be 0 in order to move to Processing Processing | 0, pushed into one of the worker jobs queues Executing | worker_idx of the worker executing the job Done | 0, wait() stops when job reaches this state.
 
JobPriority prio
 Job priority.
 
JobCreationFlags flags
 Job flags.
 
JobEdges edges
 Dependency graph.
 
util::SmallFunc func
 Function to execute when running the job.
 
- Public Attributes inherited from gaia::cnt::ilist_item
uint32_t idx
 Allocated items: Index in the list. Deleted items: Index of the next deleted item in the list.
 
ItemData data
 Item data.
 

Detailed Description

Internal storage for a scheduled job and its dependency metadata.

Member Function Documentation

◆ create()

static GAIA_NODISCARD JobContainer gaia::mt::JobContainer::create ( uint32_t  index,
uint32_t  generation,
void *  pCtx 
)
inlinestatic

Creates a new job container for the intrusive storage.

Parameters
indexStable slot index in the job pool.
generationGeneration assigned to the slot.
pCtxAllocation context carrying the requested job priority.
Returns
Initialized job container.

◆ handle()

static GAIA_NODISCARD JobHandle gaia::mt::JobContainer::handle ( const JobContainer jc)
inlinestatic

Returns the public handle associated with jc.

Parameters
jcJob container to inspect.
Returns
Handle referencing jc.

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