Photon Quantum 3.0.0

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

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

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

Public Member Functions

sealed override void OnInit (Frame f)
 Is called when the system is initialized.
 
abstract void Update (FrameThreadSafe f, EntityRef entity, T *component)
 
- 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 SliceSize => DEFAULT_SLICE_SIZE
 

Static Public Attributes

const int DEFAULT_SLICE_SIZE = 16
 The default slide size. More...
 

Protected Member Functions

virtual void OnInitUser (Frame f)
 
override TaskHandle Schedule (Frame f, TaskHandle taskHandle)
 Override to add tasks to this system.
 

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.

Threaded task: the threads will iterate over a component buffer with a size that is not known at Schedule time. Each thread will acquire a slice of a given (configurable) size until the end of the buffer is reached. While iterating over a slice, the thread will call the Update() method that can be implemented by the inheritor system, passing a FrameThreadSafe, the EntityRef and a T*.

Only access to the component itself and FrameThreadSafe is safe.

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

Template Parameters
T
Type Constraints
T :unmanaged 
T :IComponent 

Member Data Documentation

◆ DEFAULT_SLICE_SIZE

const int Quantum.Task.SystemThreadedComponent< T >.DEFAULT_SLICE_SIZE = 16
static

The default slide size.