Photon Quantum 3.0.0

Public Member Functions | Public Attributes | Protected Member Functions | List of all members
Quantum.Task.SystemArrayComponent< T > Class Template Referenceabstract

A multi-threaded system to parallelize updating components. More...

Inheritance diagram for Quantum.Task.SystemArrayComponent< T >:
Quantum.SystemBase

Public Member Functions

sealed override void OnInit (Frame f)
 Initializes the system and call the virtual OnInitUser(Frame) method. More...
 
abstract void Update (FrameThreadSafe f, EntityRef entity, T *component)
 Override to add workload. More...
 
- Public Member Functions inherited from Quantum.SystemBase
 SystemBase ()
 Constructor. More...
 
 SystemBase (string scheduleSample)
 Create a new instance and setting the sample name. More...
 
virtual void OnDisabled (Frame f)
 Is called when the system was disabled for example after Frame.SystemDisable(Type). More...
 
virtual void OnEnabled (Frame f)
 Is called when the system was enabled for example after calling Frame.SystemEnable<T>() or during QuantumGame.InitSystems(Photon.Deterministic.DeterministicFrame). More...
 
TaskHandle OnSchedule (Frame f, TaskHandle taskHandle)
 Creates the task graph for the system. More...
 

Public Attributes

virtual int SlicesCount => MAX_SLICES_COUNT / 2
 Override to specify the number of slices to use. More...
 

Protected Member Functions

virtual void OnInitUser (Frame f)
 Override to initialize a custom system. More...
 
override TaskHandle Schedule (Frame f, TaskHandle taskHandle)
 Override to schedule extra tasks. More...
 

Additional Inherited Members

- Properties inherited from Quantum.SystemBase
virtual IEnumerable< SystemBaseChildSystems [get]
 The enumerable child systems. More...
 
IEnumerable< SystemBaseHierarchy [get]
 Creates the complete sub graph of child systems. More...
 
SystemBase ParentSystem [get]
 The parent system in the system hierarchy. More...
 
Int32 RuntimeIndex [get, set]
 A unique index assigned to identify systems at runtime. More...
 
virtual Boolean StartEnabled [get, set]
 Set to true when the simulation should start with this system enabled. More...
 

Detailed Description

A multi-threaded system to parallelize updating components.

Only access to the component itself and FrameThreadSafe is safe.

Array task: similar to SystemThreadedComponent<T>, but, instead of slicing the component buffer in N slices of a fixed size each, the buffer is sliced in a fixed number of slices and the size of the slice depends on the size of the buffer, which must be known in Schedule time.

For more information request access to the online multi-threading documentation.

Template Parameters
TComponent type to update.
Type Constraints
T :unmanaged 
T :IComponent 

Member Function Documentation

◆ OnInit()

sealed override void Quantum.Task.SystemArrayComponent< T >.OnInit ( Frame  f)
inlinevirtual

Initializes the system and call the virtual OnInitUser(Frame) method.

Parameters
fThe referenced frame.

Reimplemented from Quantum.SystemBase.

◆ OnInitUser()

virtual void Quantum.Task.SystemArrayComponent< T >.OnInitUser ( Frame  f)
inlineprotectedvirtual

Override to initialize a custom system.

Parameters
fThe referenced frame.

◆ Schedule()

override TaskHandle Quantum.Task.SystemArrayComponent< T >.Schedule ( Frame  f,
TaskHandle  taskHandle 
)
inlineprotectedvirtual

Override to schedule extra tasks.

Parameters
fThe referenced frame.
taskHandleThe initial task handle.
Returns
The updated task graph.

Implements Quantum.SystemBase.

◆ Update()

abstract void Quantum.Task.SystemArrayComponent< T >.Update ( FrameThreadSafe  f,
EntityRef  entity,
T *  component 
)
pure virtual

Override to add workload.

Only access to the component itself and FrameThreadSafe is safe.

Parameters
fThe thread-safe referenced frame.
entityThe entity that the component belongs to, only read access is safe.
componentThe component to update.

Member Data Documentation

◆ SlicesCount

virtual int Quantum.Task.SystemArrayComponent< T >.SlicesCount => MAX_SLICES_COUNT / 2

Override to specify the number of slices to use.