Skip to main content

concepts Folder

Files Index

filehelios/engine/common/concepts/_module.ixx

Aggregate module re-exporting all engine role concepts. More...

fileHasClear.ixx

Concept detecting an optional clear() method. More...

fileHasInit.ixx

Concept detecting an optional init(GameWorld&) method. More...

fileHasReset.ixx

Concept detecting an optional reset() method. More...

fileHasSubmit.ixx

Concept for types that can accept commands via submit(). More...

fileHasTag.ixx

Concept for detecting a compile-time engine role tag on a type. More...

fileHasUpdate.ixx

Concept requiring a per-frame update(UpdateContext&) method. More...

fileIsCommandBufferLike.ixx

Concept constraining types usable as command buffers. More...

fileIsCommandHandlerLike.ixx

Concept constraining types that can handle specific commands. More...

fileIsManagerLike.ixx

Concept constraining types eligible for manager registration. More...

fileIsShaderLike.ixx

Concept constraining types usable as shader abstractions. More...

fileIsSystemLike.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

ConceptRequiresPurpose
HasTag<T, Tag>T::EngineRoleTag == TagDetects 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 -> boolDetects command submission capability
HasClear<T>clear() -> voidDetects clear capability
HasReset<T>reset() -> voidDetects optional reset capability

Role Constraints

ConceptRequiresPurpose
IsManagerLike<T>flush(UpdateContext&) + ManagerRoleGates GameWorld::registerResource<T>()
IsSystemLike<T>update(UpdateContext&) + SystemRoleGates SystemRegistry::add<T>()
IsCommandBufferLike<T>flush(GameWorld&, UpdateContext&) + HasClearGates command buffer registration
IsCommandHandlerLike<T, ...Cmds>submit(const Cmd&) noexcept -> bool for each CmdGates command handler registration

Structural Constraints

ConceptRequiresPurpose
IsShaderLike<T>use() + applyUniformValues(UniformValueMap&)Constrains types usable as shader abstractions

Tag-Based Opt-In

Role concepts combine structural checks with a tag requirement:

 template<class T>
 concept IsManagerLike = requires(T& t, UpdateContext& ctx) {
  { t.flush(ctx) } -> std::same_as<void>;
 } && HasTag<T, ManagerRole>;

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.