Helios Engine
A modular ECS based data-oriented C++23 game engine framework
Loading...
Searching...
No Matches
helios::utils::details Namespace Reference

Classes

struct  adapter_iterator_traits
 Traits for Iter, selecting iterator concept from Iter if it has one, else forward. More...
struct  DeferHelper
 Helper struct for the HELIOS_DEFER macro to enable inline lambda syntax. More...
struct  FixedString
 A fixed-size string that can be constructed at compile time. More...
struct  folder_apply_result
 Helper to get the result type of folder applied with accumulator + tuple elements. More...
struct  folder_apply_result< Folder, Accumulator, std::tuple< TupleArgs... > >
struct  is_folder_applicable_impl
 Helper to extract tuple element types and check if a folder is invocable with accumulator + tuple elements. More...
struct  is_folder_applicable_impl< Folder, Accumulator, std::tuple< TupleArgs... > >
struct  UniqueTypesHelper
struct  UniqueTypesHelper< T, Rest... >

Concepts

concept  CallableOrApplicable
concept  CallableOrApplicableWithReturn
concept  ClockTrait
 Concept for clock types compatible with std::chrono clocks.
concept  DurationTrait
 Concept for duration types based on std::chrono::duration.
concept  FolderApplicable
concept  IterYieldsReference
 Checks if the iterator yields a genuine reference (lvalue ref), not a proxy/value.
concept  TupleLike
 Concept to check if a type is tuple-like (has tuple_size and get).

Typedefs

template<typename Iter>
using find_result_t
 Selects pointer vs optional depending on whether the iterator yields a real ref.
template<typename Iter>
using adapter_iterator_concept_t
 Gets the iterator concept from Iter.
template<typename Iter>
using adapter_iterator_category_t
 Gets the iterator category from Iter.
template<typename Folder, typename Accumulator, typename Tuple>
using folder_apply_result_t
template<typename Func, typename... Args>
using call_or_apply_result_t
template<typename Rep, typename Period>
using NormalizedDuration = std::chrono::duration<Rep, Period>
 Helper alias to normalize a duration to its canonical std::chrono::duration form.
template<typename Clock, typename Rep, typename Period>
using NormalizedClockDuration = std::chrono::duration<Rep, Period>
 Helper alias to normalize a clock's duration to a specific rep/period.

Functions

template<typename Func, typename... Args>
consteval auto GetCallOrApplyResultType () noexcept
 Helper to get the result type of either invoke or apply.
template<typename T>
consteval std::string_view ExtractTypeName () noexcept
 Extracts the type name of T from the compiler-specific function signature.
consteval size_t CountQualifiers (std::string_view full_name) noexcept
 Counts the number of qualifiers (namespaces and class scopes) in a fully qualified type name.
constexpr std::string_view ExtractUnqualifiedName (std::string_view full_name) noexcept
 Extracts the unqualified type name from a fully qualified type name.
template<typename T>
consteval const char * GetFullTypeNameCString () noexcept
 Retrieves a null-terminated fully qualified type name for T.
template<typename T>
constexpr std::string_view GetFullTypeName () noexcept
 Retrieves the fully qualified type name of T.
template<typename T>
constexpr std::string_view GetUnqualifiedTypeName () noexcept
 Retrieves the unqualified type name of T.
template<typename T>
consteval size_t ComputeTypeHash () noexcept
 Computes a hash value for the type T based on its fully qualified name.
template<typename T>
consteval bool IsLambdaType () noexcept
 Detects whether T is a lambda closure type.
template<typename T>
consteval bool IsFunctorType () noexcept
 Detects whether T is a regular functor type (not a lambda).

Variables

template<typename T>
constexpr auto kTypeNameStorage

Typedef Documentation

◆ adapter_iterator_category_t

Initial value:
std::conditional_t< IterYieldsReference< Iter >, std::forward_iterator_tag, std::input_iterator_tag > iterator_category

Gets the iterator category from Iter.

Definition at line 58 of file functional_adapters.hpp.

◆ adapter_iterator_concept_t

Initial value:
std::conditional_t< IterYieldsReference< Iter >, std::forward_iterator_tag, std::input_iterator_tag > iterator_concept

Gets the iterator concept from Iter.

Definition at line 53 of file functional_adapters.hpp.

◆ call_or_apply_result_t

template<typename Func, typename... Args>
using helios::utils::details::call_or_apply_result_t
Initial value:
typename decltype(GetCallOrApplyResultType<Func, Args...>())::type
consteval auto GetCallOrApplyResultType() noexcept
Helper to get the result type of either invoke or apply.

Definition at line 116 of file functional_adapters.hpp.

◆ find_result_t

template<typename Iter>
using helios::utils::details::find_result_t
Initial value:
std::conditional_t<
std::remove_reference_t<std::iter_reference_t<Iter>>*, // T* / const T*
std::optional<std::iter_value_t<Iter>> // owned copy
>
Checks if the iterator yields a genuine reference (lvalue ref), not a proxy/value.

Selects pointer vs optional depending on whether the iterator yields a real ref.

Definition at line 29 of file functional_adapters.hpp.

◆ folder_apply_result_t

template<typename Folder, typename Accumulator, typename Tuple>
using helios::utils::details::folder_apply_result_t
Initial value:
Helper to get the result type of folder applied with accumulator + tuple elements.

Definition at line 97 of file functional_adapters.hpp.

◆ NormalizedClockDuration

template<typename Clock, typename Rep, typename Period>
using helios::utils::details::NormalizedClockDuration = std::chrono::duration<Rep, Period>

Helper alias to normalize a clock's duration to a specific rep/period.

Definition at line 47 of file timer.hpp.

◆ NormalizedDuration

template<typename Rep, typename Period>
using helios::utils::details::NormalizedDuration = std::chrono::duration<Rep, Period>

Helper alias to normalize a duration to its canonical std::chrono::duration form.

Definition at line 41 of file timer.hpp.

Function Documentation

◆ ComputeTypeHash()

template<typename T>
size_t helios::utils::details::ComputeTypeHash ( )
nodiscardconstevalnoexcept

Computes a hash value for the type T based on its fully qualified name.

Template Parameters
TThe type to compute the hash for
Returns
The computed hash value

Definition at line 201 of file type_info.hpp.

◆ CountQualifiers()

size_t helios::utils::details::CountQualifiers ( std::string_view full_name)
nodiscardconstevalnoexcept

Counts the number of qualifiers (namespaces and class scopes) in a fully qualified type name.

Parameters
full_nameThe fully qualified type name to analyze
Returns
The number of qualifiers in the type name

Definition at line 121 of file type_info.hpp.

◆ ExtractTypeName()

template<typename T>
std::string_view helios::utils::details::ExtractTypeName ( )
nodiscardconstevalnoexcept

Extracts the type name of T from the compiler-specific function signature.

Template Parameters
TThe type to extract the name for
Returns
The extracted type name

Definition at line 79 of file type_info.hpp.

◆ ExtractUnqualifiedName()

std::string_view helios::utils::details::ExtractUnqualifiedName ( std::string_view full_name)
nodiscardconstexprnoexcept

Extracts the unqualified type name from a fully qualified type name.

Parameters
full_nameThe fully qualified type name to extract from
Returns
The unqualified type name

Definition at line 139 of file type_info.hpp.

◆ GetCallOrApplyResultType()

template<typename Func, typename... Args>
auto helios::utils::details::GetCallOrApplyResultType ( )
constevalnoexcept

Helper to get the result type of either invoke or apply.

Definition at line 102 of file functional_adapters.hpp.

◆ GetFullTypeName()

template<typename T>
std::string_view helios::utils::details::GetFullTypeName ( )
nodiscardconstexprnoexcept

Retrieves the fully qualified type name of T.

Template Parameters
TThe type to retrieve the name for
Returns
The fully qualified type name

Definition at line 178 of file type_info.hpp.

◆ GetFullTypeNameCString()

template<typename T>
const char * helios::utils::details::GetFullTypeNameCString ( )
nodiscardconstevalnoexcept

Retrieves a null-terminated fully qualified type name for T.

Template Parameters
TThe type to retrieve the name for
Returns
Pointer to static null-terminated storage

Definition at line 168 of file type_info.hpp.

◆ GetUnqualifiedTypeName()

template<typename T>
std::string_view helios::utils::details::GetUnqualifiedTypeName ( )
nodiscardconstexprnoexcept

Retrieves the unqualified type name of T.

Template Parameters
TThe type to retrieve the name for
Returns
The unqualified type name

Definition at line 188 of file type_info.hpp.

◆ IsFunctorType()

template<typename T>
bool helios::utils::details::IsFunctorType ( )
nodiscardconstevalnoexcept

Detects whether T is a regular functor type (not a lambda).

Returns true for named structs/classes that are not lambda closure types.

Template Parameters
TType to inspect
Returns
true when T is an object type that is not a lambda

Definition at line 240 of file type_info.hpp.

◆ IsLambdaType()

template<typename T>
bool helios::utils::details::IsLambdaType ( )
nodiscardconstevalnoexcept

Detects whether T is a lambda closure type.

Prefers C++26 reflection when available (std::meta::is_class && !std::meta::has_identifier). Falls back to compiler-specific type-name heuristics otherwise.

Template Parameters
TType to inspect
Returns
true when T is a lambda closure type

Definition at line 214 of file type_info.hpp.

Variable Documentation

◆ kTypeNameStorage

template<typename T>
auto helios::utils::details::kTypeNameStorage
inlineconstexpr
Initial value:
=
consteval std::string_view ExtractTypeName() noexcept
Extracts the type name of T from the compiler-specific function signature.
Definition type_info.hpp:79
A fixed-size string that can be constructed at compile time.
Definition type_info.hpp:61

Definition at line 159 of file type_info.hpp.