|
VLink 2.0.0
A high-performance communication middleware
|
Compile-time type-name and enum-name detection utilities. More...
#include <string_view>#include "../thirdparty/nameof.h"Go to the source code of this file.
Namespaces | |
| namespace | vlink |
| namespace | vlink::NameDetector |
| Compile-time type-name and enum-name detection utilities. | |
Functions | |
| template<typename T> | |
| constexpr bool | vlink::NameDetector::is_support () noexcept |
Checks at compile time whether the nameof library can produce a type name for T. | |
| template<typename T> | |
| constexpr std::string_view | vlink::NameDetector::get () noexcept |
Returns the unqualified compile-time name of type T as a std::string_view. | |
| template<typename T> | |
| std::string_view | vlink::NameDetector::get_enum (T e) noexcept |
Returns the string representation of an enumeration value e. | |
Compile-time type-name and enum-name detection utilities.
The vlink::NameDetector namespace wraps the third-party nameof library to provide a portable, constexpr API for obtaining the string representation of a type or an enumeration value at compile time.
These utilities are used by the VLink plugin system to automatically derive plugin identifiers from interface class names, avoiding error-prone manual string registration.
Platform notes:
nameof library may prefix types with "struct " or "class ". NameDetector::get() strips these prefixes automatically to return only the unqualified type name.nameof::nameof_type<T>() is used directly.get<T>() function returns a constexpr std::string_view that points into static storage generated by the compiler. The view is valid for the entire program lifetime.