VLink  2.0.0
A high-performance communication middleware
vlink::NameDetector Namespace Reference

Compile-time type-name and enum-name reflection primitives. More...

Namespaces

 
 

Functions

template<typename TypeT >
constexpr bool is_support () noexcept
 Reports whether the current toolchain can extract a textual name for TypeT. More...
 
template<typename TypeT >
constexpr std::string_view get () noexcept
 Returns the trimmed compile-time identifier for TypeT. More...
 
template<typename EnumT >
constexpr std::string_view get_enum (EnumT value) noexcept
 Resolves the source identifier of an enumerator literal at compile time. More...
 

Detailed Description

Compile-time type-name and enum-name reflection primitives.

Details.

Function Documentation

◆ get()

template<typename TypeT >
constexpr std::string_view vlink::NameDetector::get ( )
inlineconstexprnoexcept

Returns the trimmed compile-time identifier for TypeT.

MSVC inserts a "struct " or "class " prefix into FUNCSIG; both are stripped before the value is returned so the same textual identifier is produced on every supported toolchain. The returned view always points at static read-only storage.

Template Parameters
TypeTType whose identifier is requested.
Returns
Read-only std::string_view with the resolved identifier.
Here is the caller graph for this function:

◆ get_enum()

template<typename EnumT >
constexpr std::string_view vlink::NameDetector::get_enum ( EnumT  value)
inlineconstexprnoexcept

Resolves the source identifier of an enumerator literal at compile time.

Template Parameters
EnumTEnumeration type, deduced from value.
Parameters
valueEnumerator value whose label is requested.
Returns
Identifier text, or an empty view when value is outside the configured scanning window or is not a named enumerator.

◆ is_support()

template<typename TypeT >
constexpr bool vlink::NameDetector::is_support ( )
inlineconstexprnoexcept

Reports whether the current toolchain can extract a textual name for TypeT.

Template Parameters
TypeTType whose support status is queried.
Returns
true when get<TypeT>() returns a meaningful non-empty view on this compiler.