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

Classes

struct  TypeNameSupported
 
struct  EnumNameSupported
 
class  CString
 
struct  ValidCountResult
 

Typedefs

template<typename TypeT >
using RemoveCvrefT = std::remove_cv_t< std::remove_reference_t< TypeT > >
 

Functions

constexpr std::string_view pretty_name (std::string_view name, bool remove_suffix=true) noexcept
 
template<typename TypeT , size_t SizeT, size_t... IndexT>
constexpr std::array< std::remove_cv_t< TypeT >, SizeT > to_array (TypeT(&a)[SizeT], std::index_sequence< IndexT... >) noexcept
 
template<typename LeftT , typename RightT >
constexpr bool cmp_less (LeftT lhs, RightT rhs) noexcept
 
template<typename EnumT , EnumT ValueV>
constexpr auto raw_enum_name () noexcept
 
template<typename EnumT , EnumT ValueV>
constexpr auto enum_name () noexcept
 
template<typename EnumT , auto ValueV>
constexpr bool is_valid () noexcept
 
template<typename EnumT , int OffsetT, typename UnderlyingT = std::underlying_type_t<EnumT>>
constexpr UnderlyingT ualue (size_t i) noexcept
 
template<typename EnumT , int OffsetT, typename UnderlyingT = std::underlying_type_t<EnumT>>
constexpr EnumT enum_value_at (size_t i) noexcept
 
template<typename EnumT , typename UnderlyingT = std::underlying_type_t<EnumT>>
constexpr int reflected_min () noexcept
 
template<typename EnumT , typename UnderlyingT = std::underlying_type_t<EnumT>>
constexpr int reflected_max () noexcept
 
template<typename EnumT , size_t SizeT, int MinT, size_t IndexT>
constexpr void valid_count_step (bool *valid, size_t &count) noexcept
 
template<typename EnumT , size_t SizeT, int MinT>
constexpr auto valid_count () noexcept
 
template<typename EnumT , size_t SizeT, int MinT>
constexpr auto values_in_range () noexcept
 
template<typename EnumT , typename UnderlyingT = std::underlying_type_t<EnumT>>
constexpr auto values () noexcept
 
template<typename EnumT , size_t... IndexT>
constexpr auto names_impl (std::index_sequence< IndexT... >) noexcept
 
template<typename EnumT , typename UnderlyingT = std::underlying_type_t<EnumT>>
constexpr bool is_sparse () noexcept
 
template<typename EnumT , typename UnderlyingT = std::underlying_type_t<EnumT>>
constexpr EnumT enum_value (size_t i) noexcept
 
template<typename TypeT >
constexpr auto raw_type_name () noexcept
 

Variables

template<typename TypeT >
constexpr bool kIsEnum = std::is_enum_v<TypeT> && std::is_same_v<TypeT, std::decay_t<TypeT>>
 
template<typename EnumT , EnumT ValueV>
constexpr auto kEnumName = enum_name<EnumT, ValueV>()
 
template<typename EnumT >
constexpr auto kValues = values<EnumT>()
 
template<typename EnumT >
constexpr auto kCount = kValues<EnumT>.size()
 
template<typename EnumT , typename UnderlyingT = std::underlying_type_t<EnumT>>
constexpr UnderlyingT kMinTalue
 
template<typename EnumT , typename UnderlyingT = std::underlying_type_t<EnumT>>
constexpr UnderlyingT kMaxValue
 
template<typename EnumT >
constexpr auto kNames = names_impl<EnumT>(std::make_index_sequence<kCount<EnumT>>{})
 
template<typename EnumT >
constexpr bool kIsSparse = is_sparse<EnumT>()
 
template<typename TypeT >
constexpr auto kTypeName = raw_type_name<TypeT>()
 

Typedef Documentation

◆ RemoveCvrefT

template<typename TypeT >
using vlink::NameDetector::detail::RemoveCvrefT = typedef std::remove_cv_t<std::remove_reference_t<TypeT> >

Function Documentation

◆ cmp_less()

template<typename LeftT , typename RightT >
constexpr bool vlink::NameDetector::detail::cmp_less ( LeftT  lhs,
RightT  rhs 
)
constexprnoexcept
Here is the caller graph for this function:

◆ enum_name()

template<typename EnumT , EnumT ValueV>
constexpr auto vlink::NameDetector::detail::enum_name ( )
constexprnoexcept
Here is the call graph for this function:

◆ enum_value()

template<typename EnumT , typename UnderlyingT = std::underlying_type_t<EnumT>>
constexpr EnumT vlink::NameDetector::detail::enum_value ( size_t  i)
constexprnoexcept

◆ enum_value_at()

template<typename EnumT , int OffsetT, typename UnderlyingT = std::underlying_type_t<EnumT>>
constexpr EnumT vlink::NameDetector::detail::enum_value_at ( size_t  i)
constexprnoexcept

◆ is_sparse()

template<typename EnumT , typename UnderlyingT = std::underlying_type_t<EnumT>>
constexpr bool vlink::NameDetector::detail::is_sparse ( )
constexprnoexcept

◆ is_valid()

template<typename EnumT , auto ValueV>
constexpr bool vlink::NameDetector::detail::is_valid ( )
constexprnoexcept

◆ names_impl()

template<typename EnumT , size_t... IndexT>
constexpr auto vlink::NameDetector::detail::names_impl ( std::index_sequence< IndexT... >  )
constexprnoexcept

◆ pretty_name()

constexpr std::string_view vlink::NameDetector::detail::pretty_name ( std::string_view  name,
bool  remove_suffix = true 
)
constexprnoexcept
Here is the caller graph for this function:

◆ raw_enum_name()

template<typename EnumT , EnumT ValueV>
constexpr auto vlink::NameDetector::detail::raw_enum_name ( )
constexprnoexcept
Here is the call graph for this function:

◆ raw_type_name()

template<typename TypeT >
constexpr auto vlink::NameDetector::detail::raw_type_name ( )
constexprnoexcept

◆ reflected_max()

template<typename EnumT , typename UnderlyingT = std::underlying_type_t<EnumT>>
constexpr int vlink::NameDetector::detail::reflected_max ( )
constexprnoexcept
Here is the call graph for this function:

◆ reflected_min()

template<typename EnumT , typename UnderlyingT = std::underlying_type_t<EnumT>>
constexpr int vlink::NameDetector::detail::reflected_min ( )
constexprnoexcept
Here is the call graph for this function:

◆ to_array()

template<typename TypeT , size_t SizeT, size_t... IndexT>
constexpr std::array<std::remove_cv_t<TypeT>, SizeT> vlink::NameDetector::detail::to_array ( TypeT(&)  a[SizeT],
std::index_sequence< IndexT... >   
)
constexprnoexcept
Here is the caller graph for this function:

◆ ualue()

template<typename EnumT , int OffsetT, typename UnderlyingT = std::underlying_type_t<EnumT>>
constexpr UnderlyingT vlink::NameDetector::detail::ualue ( size_t  i)
constexprnoexcept

◆ valid_count()

template<typename EnumT , size_t SizeT, int MinT>
constexpr auto vlink::NameDetector::detail::valid_count ( )
constexprnoexcept

◆ valid_count_step()

template<typename EnumT , size_t SizeT, int MinT, size_t IndexT>
constexpr void vlink::NameDetector::detail::valid_count_step ( bool *  valid,
size_t &  count 
)
constexprnoexcept

◆ values()

template<typename EnumT , typename UnderlyingT = std::underlying_type_t<EnumT>>
constexpr auto vlink::NameDetector::detail::values ( )
constexprnoexcept

◆ values_in_range()

template<typename EnumT , size_t SizeT, int MinT>
constexpr auto vlink::NameDetector::detail::values_in_range ( )
constexprnoexcept
Here is the call graph for this function:

Variable Documentation

◆ kCount

template<typename EnumT >
constexpr auto vlink::NameDetector::detail::kCount = kValues<EnumT>.size()
inlineconstexpr

◆ kEnumName

template<typename EnumT , EnumT ValueV>
constexpr auto vlink::NameDetector::detail::kEnumName = enum_name<EnumT, ValueV>()
inlineconstexpr

◆ kIsEnum

template<typename TypeT >
constexpr bool vlink::NameDetector::detail::kIsEnum = std::is_enum_v<TypeT> && std::is_same_v<TypeT, std::decay_t<TypeT>>
inlineconstexpr

◆ kIsSparse

template<typename EnumT >
constexpr bool vlink::NameDetector::detail::kIsSparse = is_sparse<EnumT>()
inlineconstexpr

◆ kMaxValue

template<typename EnumT , typename UnderlyingT = std::underlying_type_t<EnumT>>
constexpr UnderlyingT vlink::NameDetector::detail::kMaxValue
inlineconstexpr
Initial value:
=
(kCount<EnumT> > 0) ? static_cast<UnderlyingT>(kValues<EnumT>.back()) : UnderlyingT{0}

◆ kMinTalue

template<typename EnumT , typename UnderlyingT = std::underlying_type_t<EnumT>>
constexpr UnderlyingT vlink::NameDetector::detail::kMinTalue
inlineconstexpr
Initial value:
=
(kCount<EnumT> > 0) ? static_cast<UnderlyingT>(kValues<EnumT>.front()) : UnderlyingT{0}

◆ kNames

template<typename EnumT >
constexpr auto vlink::NameDetector::detail::kNames = names_impl<EnumT>(std::make_index_sequence<kCount<EnumT>>{})
inlineconstexpr

◆ kTypeName

template<typename TypeT >
constexpr auto vlink::NameDetector::detail::kTypeName = raw_type_name<TypeT>()
inlineconstexpr

◆ kValues

template<typename EnumT >
constexpr auto vlink::NameDetector::detail::kValues = values<EnumT>()
inlineconstexpr