Helios Engine
A modular ECS based data-oriented C++23 game engine framework
Loading...
Searching...
No Matches

#include <type_info.hpp>

Public Member Functions

constexpr TypeId () noexcept=default
 Constructs empty TypeId.
constexpr TypeId (const TypeId &) noexcept=default
constexpr TypeId (TypeId &&) noexcept=default
constexpr ~TypeId () noexcept=default
constexpr TypeIdoperator= (const TypeId &) noexcept=default
constexpr TypeIdoperator= (TypeId &&) noexcept=default
constexpr bool Empty () const noexcept
 Checks if this TypeId is empty (i.e., has a hash value of 0).
constexpr std::string_view Name () const noexcept
 Retrieves the unqualified name of the type represented by this TypeId.
constexpr std::string_view QualifiedName () const noexcept
 Retrieves the fully qualified name of the type represented by this TypeId.
constexpr TypeIndex Index () const noexcept
 Retrieves the type index associated with this TypeId.
constexpr std::strong_ordering operator<=> (const TypeId &other) const noexcept
constexpr bool operator== (const TypeId &other) const noexcept

Static Public Member Functions

template<typename T>
static constexpr TypeId From () noexcept
 Constructs a TypeId from a type T.
template<typename T>
static constexpr TypeId From (const T &) noexcept
 Constructs a TypeId from an instance of type T.
static constexpr TypeId FromExported (uint64_t hash, std::string_view qualified_name={}) noexcept
 Constructs a TypeId from a precomputed hash and optional name.

Detailed Description

Definition at line 321 of file type_info.hpp.

Constructor & Destructor Documentation

◆ TypeId() [1/3]

helios::utils::TypeId::TypeId ( )
constexprdefaultnoexcept

Constructs empty TypeId.

◆ TypeId() [2/3]

helios::utils::TypeId::TypeId ( const TypeId & )
constexprdefaultnoexcept

◆ TypeId() [3/3]

helios::utils::TypeId::TypeId ( TypeId && )
constexprdefaultnoexcept

◆ ~TypeId()

helios::utils::TypeId::~TypeId ( )
constexprdefaultnoexcept

Member Function Documentation

◆ Empty()

bool helios::utils::TypeId::Empty ( ) const
inlinenodiscardconstexprnoexcept

Checks if this TypeId is empty (i.e., has a hash value of 0).

Returns
true if this TypeId is empty, false otherwise

Definition at line 368 of file type_info.hpp.

◆ From() [1/2]

template<typename T>
constexpr TypeId helios::utils::TypeId::From ( )
inlinestaticnodiscardconstexprnoexcept

Constructs a TypeId from a type T.

Template Parameters
TThe type to construct the TypeId for
Returns
TypeId representing the type T

Definition at line 335 of file type_info.hpp.

◆ From() [2/2]

template<typename T>
constexpr TypeId helios::utils::TypeId::From ( const T & )
inlinestaticnodiscardconstexprnoexcept

Constructs a TypeId from an instance of type T.

Template Parameters
TThe type of the instance
Parameters
instanceThe instance to construct the TypeId from (unused)
Returns
TypeId representing the type of the instance

Definition at line 346 of file type_info.hpp.

◆ FromExported()

constexpr TypeId helios::utils::TypeId::FromExported ( uint64_t hash,
std::string_view qualified_name = {} )
inlinestaticnodiscardconstexprnoexcept

Constructs a TypeId from a precomputed hash and optional name.

Parameters
hashType hash (TypeIndex::Hash() for the source type)
qualified_nameOptional qualified type name
Returns
TypeId with the given identity

Definition at line 356 of file type_info.hpp.

◆ Index()

TypeIndex helios::utils::TypeId::Index ( ) const
inlinenodiscardconstexprnoexcept

Retrieves the type index associated with this TypeId.

Returns
TypeIndex for stored type

Definition at line 394 of file type_info.hpp.

◆ Name()

std::string_view helios::utils::TypeId::Name ( ) const
inlinenodiscardconstexprnoexcept

Retrieves the unqualified name of the type represented by this TypeId.

Returns
Unqualified type name or empty string if this TypeId is empty

Definition at line 377 of file type_info.hpp.

◆ operator<=>()

std::strong_ordering helios::utils::TypeId::operator<=> ( const TypeId & other) const
inlinenodiscardconstexprnoexcept

Definition at line 398 of file type_info.hpp.

◆ operator=() [1/2]

TypeId & helios::utils::TypeId::operator= ( const TypeId & )
constexprdefaultnoexcept

◆ operator=() [2/2]

TypeId & helios::utils::TypeId::operator= ( TypeId && )
constexprdefaultnoexcept

◆ operator==()

bool helios::utils::TypeId::operator== ( const TypeId & other) const
inlinenodiscardconstexprnoexcept

Definition at line 403 of file type_info.hpp.

◆ QualifiedName()

std::string_view helios::utils::TypeId::QualifiedName ( ) const
inlinenodiscardconstexprnoexcept

Retrieves the fully qualified name of the type represented by this TypeId.

Returns
Fully qualified type name or empty string if this TypeId is empty

Definition at line 386 of file type_info.hpp.