System
- Module
- ECS
- Header
#include "ECS/System.h"- Namespace
Mowo
Constructors
| Signature | Name | Description |
|---|---|---|
virtual ~System() = default | ~System |
Public functions
| Returns | Name | Description |
|---|---|---|
ComponentMask | MakeComponentMask | |
SystemPhase | GetPhase | |
bool | DeclaresComponentAccess | Declaring reads and writes lets ComputeParallelBatches run this system concurrently with non-conflicting systems in the same phase. |
ComponentMask | GetReadMask | |
ComponentMask | GetWriteMask | |
uint32_t | GetResourceReadMask | |
uint32_t | GetResourceWriteMask | |
const char* | GetDebugName | Names the profiler scope World::Update wraps around this system's Update, so all registered systems show up in a capture without each one carrying its own scope. |
void | Initialize | |
void | Shutdown | |
void | Update | |
bool | SystemsConflict | Two systems conflict — must stay ordered and may not run together — when either fails to declare its access, or their declared accesses race: write/write on a shared component, or one's write touching the other's read. |
std::vector<std::vector<size_t>> | ComputeParallelBatches | Group systems (already filtered to one phase, in registration order) into ordered batches. |
World* | GetWorld |
Function details
~System
virtual ~System() = defaultMakeComponentMask
template<typename... Ts> static ComponentMask MakeComponentMask()GetPhase
virtual SystemPhase GetPhase() constDeclaresComponentAccess
virtual bool DeclaresComponentAccess() constDeclaring reads and writes lets ComputeParallelBatches run this system concurrently with non-conflicting systems in the same phase. Declaring nothing means conflicting with everything, i.e. serial in registration order — so this is purely opt-in.
GetReadMask
virtual ComponentMask GetReadMask() constGetWriteMask
virtual ComponentMask GetWriteMask() constGetResourceReadMask
virtual uint32_t GetResourceReadMask() constGetResourceWriteMask
virtual uint32_t GetResourceWriteMask() constGetDebugName
virtual const char* GetDebugName() constNames the profiler scope World::Update wraps around this system's Update, so all registered systems show up in a capture without each one carrying its own scope. The default resolves to the concrete type (MSVC renders it "class Mowo::FCoverSystem"); the returned pointer must outlive the frame, so overrides return string literals.
Initialize
virtual void Initialize(World* world)Shutdown
virtual void Shutdown()Update
virtual void Update(float deltaTime) = 0SystemsConflict
static bool SystemsConflict(const System& a, const System& b)Two systems conflict — must stay ordered and may not run together — when either fails to declare its access, or their declared accesses race: write/write on a shared component, or one's write touching the other's read. Read/read alone never conflicts.
ComputeParallelBatches
static std::vector<std::vector<size_t>> ComputeParallelBatches( const std::vector<System*>& systems)Group systems (already filtered to one phase, in registration order) into ordered batches. Every system within a batch is pairwise conflict-free, so a batch can run concurrently; batches run in order. A system never lands in an earlier batch than an earlier-registered system it conflicts with, so dependent ordering is preserved. Levels: level(i) = 1 + max level among earlier systems that conflict with i; two systems at the same level are provably non-conflicting.
GetWorld
World* GetWorld() const