tasks_traits.h File Reference
#include <Eigen/Core>
#include <type_traits>
Include dependency graph for tasks_traits.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 mc_tasks
 
 mc_tasks::details
 

Macros

#define MAKE_GETTER_DETECTOR(GETTER)
 
#define MAKE_SETTER_DETECTOR(SETTER)
 

Functions

 mc_tasks::details::MAKE_GETTER_DETECTOR (refVel)
 
 mc_tasks::details::MAKE_SETTER_DETECTOR (refVel)
 
 mc_tasks::details::MAKE_GETTER_DETECTOR (refAccel)
 
 mc_tasks::details::MAKE_SETTER_DETECTOR (refAccel)
 

Variables

template<typename T >
constexpr bool mc_tasks::details::has_refVel_v = has_refVel_getter_v<T> && has_refVel_setter_v<T>
 
template<typename T >
constexpr bool mc_tasks::details::has_refAccel_v = has_refAccel_getter_v<T> && has_refAccel_setter_v<T>
 
template<typename T >
constexpr bool mc_tasks::details::always_false_v = false
 

Macro Definition Documentation

◆ MAKE_GETTER_DETECTOR

#define MAKE_GETTER_DETECTOR (   GETTER)
Value:
namespace impl \
{ \
template<typename T> \
struct GETTER##_getter_traits \
{ \
template<typename U> \
static constexpr std::true_type test_has(std::void_t<decltype(std::declval<U>().GETTER())> * = nullptr); \
template<typename U> \
static constexpr std::false_type test_has(...); \
static constexpr bool has = decltype(test_has<T>(0))::value; \
template<typename U> \
static auto test(std::void_t<decltype(std::declval<const U>().GETTER())> * = nullptr) \
-> decltype(std::declval<const U>().GETTER()); \
template<typename U> \
static void test(...); \
using type = decltype(test<T>(0)); \
}; \
} \
template<typename T> \
inline constexpr bool has_##GETTER##_getter_v = impl::GETTER##_getter_traits<T>::has; \
template<typename T> \
using GETTER##_return_t = typename impl::GETTER##_getter_traits<T>::type

◆ MAKE_SETTER_DETECTOR

#define MAKE_SETTER_DETECTOR (   SETTER)
Value:
namespace impl \
{ \
template<typename T> \
struct has_##SETTER##_setter \
{ \
template<typename U> \
static constexpr std::true_type test( \
std::void_t<decltype(std::declval<U>().SETTER(std::declval<Eigen::VectorXd>()))> * = nullptr); \
template<typename U> \
static constexpr std::false_type test(...); \
static constexpr bool value = decltype(test<T>(0))::value; \
}; \
} \
template<typename T> \
inline constexpr bool has_##SETTER##_setter_v = impl::has_##SETTER##_setter<T>::value
mc_rtc::gui::details::void_t
void void_t
Definition: traits.h:25