WebCFace 2.5.2
Web-based Communication Framework & Dashboard-like UI
Loading...
Searching...
No Matches
webcface::traits Namespace Reference

Classes

struct  ArrayLikeTrait
 
struct  ArrayLikeTrait< T(&)[N]>
 
struct  ArrayLikeTrait< T[N]>
 
struct  ArrayLikeTraitCheck
 
struct  ArrayLikeTraitCheck< true >
 
struct  ArraySizeTrait
 
struct  ArraySizeTrait< T(&)[N], Num >
 
struct  ArraySizeTrait< T[N], Num >
 
struct  ArraySizeTraitCheck
 
struct  ArraySizeTraitCheck< true >
 
struct  FuncArgTypeCheck
 
struct  FuncArgTypeCheck< true >
 
struct  FuncArgTypesTrait
 
struct  FuncReturnTypeCheck
 
struct  FuncReturnTypeCheck< true >
 
struct  FuncReturnTypeTrait
 
struct  FuncSignatureTrait
 
struct  FuncSignatureTrait< Ret(*)(Args...)>
 
struct  FuncSignatureTrait< Ret(Args...)>
 
struct  FuncSignatureTrait< Ret(T::*)(Args...) const >
 
struct  FuncSignatureTrait< Ret(T::*)(Args...)>
 

Typedefs

template<typename T >
using IsArrayLike = decltype(isArrayLike(std::declval< T >()))
 
template<typename T , std::size_t Num>
using ArraySizeMatch = decltype(arraySizeMatch(std::declval< T >(), std::integral_constant< std::size_t, Num >()))
 
template<typename T >
using InvokeSignature = decltype(getInvokeSignature(std::declval< std::decay_t< T > >()))
 
template<typename T >
using FuncObjTrait = FuncSignatureTrait< InvokeSignature< T > >
 
using TraitOkType = std::nullptr_t
 

Functions

constexpr std::false_type isArrayLike (...)
 
template<typename T >
constexpr auto isArrayLike (T) -> std::bool_constant< std::is_convertible_v< decltype(*std::begin(std::declval< T >())), double > &&std::is_convertible_v< decltype(*std::end(std::declval< T >())), double > >
 
constexpr std::true_type arraySizeMatch (...)
 
template<typename T , std::size_t Num>
constexpr auto arraySizeMatch (T, std::integral_constant< std::size_t, Num >) -> std::bool_constant< std::tuple_size< T >::value==Num >
 
template<typename T >
std::vector< double > arrayLikeToVector (const T &array)
 
template<std::size_t Num, typename T >
std::array< double, Num > arrayLikeToArray (const T &array)
 
template<typename T >
constexpr auto getInvokeSignature (T &&) -> decltype(&T::operator())
 
template<typename Ret , typename... Args>
constexpr auto getInvokeSignature (Ret(*p)(Args...))
 

Variables

constexpr std::nullptr_t TraitOk = nullptr
 

Typedef Documentation

◆ ArraySizeMatch

template<typename T , std::size_t Num>
using ArraySizeMatch = decltype(arraySizeMatch( std::declval<T>(), std::integral_constant<std::size_t, Num>()))

◆ FuncObjTrait

template<typename T >
using FuncObjTrait = FuncSignatureTrait<InvokeSignature<T> >
  • Tは関数オブジェクト型、または関数型
  • InvokeSignature<T> で関数呼び出しの型 ( Ret(*)(Args...) や Ret(T::*)(Args...) ) を取得し、
  • FuncSignatureTrait<Ret(Args...)> が各種メンバー型や定数を定義する

◆ InvokeSignature

template<typename T >
using InvokeSignature = decltype(getInvokeSignature(std::declval<std::decay_t<T> >()))

◆ IsArrayLike

template<typename T >
using IsArrayLike = decltype(isArrayLike(std::declval<T>()))

◆ TraitOkType

using TraitOkType = std::nullptr_t

Function Documentation

◆ arrayLikeToArray()

template<std::size_t Num, typename T >
std::array< double, Num > arrayLikeToArray ( const T &  array)

◆ arrayLikeToVector()

template<typename T >
std::vector< double > arrayLikeToVector ( const T &  array)

◆ arraySizeMatch() [1/2]

constexpr std::true_type arraySizeMatch (   ...)
constexpr

◆ arraySizeMatch() [2/2]

template<typename T , std::size_t Num>
constexpr auto arraySizeMatch ( ,
std::integral_constant< std::size_t, Num >   
) -> std::bool_constant<std::tuple_size<T>::value == Num>
constexpr

◆ getInvokeSignature() [1/2]

template<typename Ret , typename... Args>
constexpr auto getInvokeSignature ( Ret(*)(Args...)  p)
constexpr

◆ getInvokeSignature() [2/2]

template<typename T >
constexpr auto getInvokeSignature ( T &&  ) -> decltype(&T::operator())
constexpr

◆ isArrayLike() [1/2]

constexpr std::false_type isArrayLike (   ...)
constexpr

◆ isArrayLike() [2/2]

template<typename T >
constexpr auto isArrayLike ( ) -> std::bool_constant< std::is_convertible_v<decltype(*std::begin(std::declval<T>())), double> && std::is_convertible_v<decltype(*std::end(std::declval<T>())), double>>
constexpr

Variable Documentation

◆ TraitOk

constexpr std::nullptr_t TraitOk = nullptr
constexpr