guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
Loading...
Searching...
No Matches
guillaume::ecs::ComponentTypeId Class Reference

Gives each component type a small number: its bit position in an Entity::Signature. More...

#include <headers/guillaume/ecs/component_type_id.hpp>

Static Public Member Functions

template<typename ComponentType>
static std::size_t get (void)
 Get the number of a component type, assigning one on the first call for that type.

Detailed Description

Gives each component type a small number: its bit position in an Entity::Signature.

Numbers are handed out in the order the types are first asked for, starting at 0, and stay the same for the rest of the program. They are not stable from one run to the next, so never store them.

static std::size_t get(void)
Get the number of a component type, assigning one on the first call for that type.
std::bitset< 128 > Signature
A set of component types, one bit per type (bit position given by ComponentTypeId,...
Definition entity.hpp:91
See also
Entity::getSignatureFromTypes
MaxComponentTypes

Definition at line 78 of file component_type_id.hpp.

Member Function Documentation

◆ get()

template<typename ComponentType>
std::size_t guillaume::ecs::ComponentTypeId::get ( void )
inlinestatic

Get the number of a component type, assigning one on the first call for that type.

Template Parameters
ComponentTypeThe component type.
Returns
The number of the type, from 0 to MaxComponentTypes - 1. The same value is returned on every call for the same type.
Exceptions
ComponentTypeLimitExceededExceptionOn the first call for a type when MaxComponentTypes numbers are already in use.

Definition at line 90 of file component_type_id.hpp.


The documentation for this class was generated from the following files: