concepts Folder
Files Index
| file | helios/engine/common/concepts/_module.ixx |
|
Aggregate module re-exporting all engine role concepts. More... | |
| file | HasClear.ixx |
|
Concept detecting an optional clear() method. More... | |
| file | HasInit.ixx |
|
Concept detecting an optional init(GameWorld&) method. More... | |
| file | HasReset.ixx |
|
Concept detecting an optional reset() method. More... | |
| file | HasSubmit.ixx |
|
Concept for types that can accept commands via submit(). More... | |
| file | HasTag.ixx |
|
Concept for detecting a compile-time engine role tag on a type. More... | |
| file | HasUpdate.ixx |
|
Concept requiring a per-frame update(UpdateContext&) method. More... | |
| file | IsCommandBufferLike.ixx |
|
Concept constraining types usable as command buffers. More... | |
| file | IsCommandHandlerLike.ixx |
|
Concept constraining types that can handle specific commands. More... | |
| file | IsManagerLike.ixx |
|
Concept constraining types eligible for manager registration. More... | |
| file | IsShaderLike.ixx |
|
Concept constraining types usable as shader abstractions. More... | |
| file | IsSystemLike.ixx |
|
Concept constraining types eligible for system registration. More... | |
Description
helios::engine::common::concepts
Compile-time concepts for engine role classification and capability detection.
Overview
This module provides C++20 concepts that constrain types for specific engine roles (System, Manager, CommandBuffer, CommandHandler). The concepts combine structural requirements (e.g. flush(), update()) with explicit opt-in via the tag system, preventing accidental registration of types that happen to have matching method signatures.
Concepts
Capability Detection
| Concept | Requires | Purpose |
|---|---|---|
| HasTag<T, Tag> | T::EngineRoleTag == Tag | Detects compile-time role tag |
| HasInit<T> | init(GameWorld&) | Detects optional one-time initialization |
| HasUpdate<T> | update(UpdateContext&) | Detects per-frame update capability |
| HasSubmit<T, Cmd> | submit(const Cmd&) noexcept -> bool | Detects command submission capability |
| HasClear<T> | clear() -> void | Detects clear capability |
| HasReset<T> | reset() -> void | Detects optional reset capability |
Role Constraints
| Concept | Requires | Purpose |
|---|---|---|
| IsManagerLike<T> | flush(UpdateContext&) + ManagerRole | Gates GameWorld::registerResource<T>() |
| IsSystemLike<T> | update(UpdateContext&) + SystemRole | Gates SystemRegistry::add<T>() |
| IsCommandBufferLike<T> | flush(GameWorld&, UpdateContext&) + HasClear | Gates command buffer registration |
| IsCommandHandlerLike<T, ...Cmds> | submit(const Cmd&) noexcept -> bool for each Cmd | Gates command handler registration |
Structural Constraints
| Concept | Requires | Purpose |
|---|---|---|
| IsShaderLike<T> | use() + applyUniformValues(UniformValueMap&) | Constrains types usable as shader abstractions |
Tag-Based Opt-In
Role concepts combine structural checks with a tag requirement:
This means a type must both implement the required interface and declare using EngineRoleTag = ManagerRole; to be eligible for registration.
See Also
- Tags — Role tag types
- System — System architecture
- Command System — Manager and handler registration
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.