mc_rtc::schema::details Namespace Reference

Classes

struct  Choices
 
struct  Choices< false >
 
struct  EmptySchema
 
struct  is_eigen_vector
 
struct  is_eigen_vector< Eigen::Matrix< Scalar, Rows, 1, Options, MaxRows, 1 > >
 
struct  is_schema
 
struct  is_std_map
 
struct  is_std_map< std::map< std::string, T > >
 
struct  is_std_vector
 
struct  is_std_vector< std::vector< T, Allocator > >
 
struct  MemberPointerWrapper
 

Functions

template<typename T , bool IsRequired, bool IsInteractive, bool HasChoices = false, bool IsStatic = false>
void addValueToForm (const T &value, const std::string &description, const details::Choices< HasChoices > &choices, gui::details::FormElements &form)
 
template<bool IsRequired, bool IsInteractive, bool HasChoices, typename... Args>
void variantToForm (const std::variant< Args... > &, gui::details::FormElements &form, const Choices< HasChoices > &choices)
 
template<typename T , ValueFlag Flags = ValueFlag::All, bool HasChoices = false>
const T & get_default (const T &default_, const std::integral_constant< ValueFlag, Flags > &={}, const details::Choices< HasChoices > &choices={})
 

Variables

template<typename T >
constexpr bool is_schema_v = decltype(is_schema::test<T>(nullptr))::value
 
template<typename T >
constexpr bool is_std_vector_v = is_std_vector<T>::value
 
template<typename T >
constexpr bool is_std_vector_schema_v
 
template<typename T >
constexpr bool is_std_map_v = is_std_map<T>::value
 
template<typename T >
constexpr bool is_std_map_schema_v
 
template<typename T >
constexpr bool is_eigen_vector_v = is_eigen_vector<T>::value
 

Function Documentation

◆ addValueToForm()

template<typename T , bool IsRequired, bool IsInteractive, bool HasChoices = false, bool IsStatic = false>
void mc_rtc::schema::details::addValueToForm ( const T &  value,
const std::string &  description,
const details::Choices< HasChoices > &  choices,
gui::details::FormElements form 
)

◆ get_default()

template<typename T , ValueFlag Flags = ValueFlag::All, bool HasChoices = false>
const T& mc_rtc::schema::details::get_default ( const T &  default_,
const std::integral_constant< ValueFlag, Flags > &  = {},
const details::Choices< HasChoices > &  choices = {} 
)

Gets a default value:

  • if IsRequired is true, HasChoices is true and the choices are not empty this returns the first choice
  • otherwise returns the default value provided

◆ variantToForm()

template<bool IsRequired, bool IsInteractive, bool HasChoices, typename... Args>
void mc_rtc::schema::details::variantToForm ( const std::variant< Args... > &  ,
gui::details::FormElements form,
const Choices< HasChoices > &  choices 
)

Variable Documentation

◆ is_eigen_vector_v

template<typename T >
constexpr bool mc_rtc::schema::details::is_eigen_vector_v = is_eigen_vector<T>::value
inlineconstexpr

◆ is_schema_v

template<typename T >
constexpr bool mc_rtc::schema::details::is_schema_v = decltype(is_schema::test<T>(nullptr))::value
inlineconstexpr

◆ is_std_map_schema_v

template<typename T >
constexpr bool mc_rtc::schema::details::is_std_map_schema_v
inlineconstexpr
Initial value:
= []()
{
if constexpr(is_std_map_v<T>) { return is_schema_v<typename T::value_type>; }
else { return false; }
}()

Type-trait to detect an std::map<Key, ValueT> where ValueT is a Schema-based type

◆ is_std_map_v

template<typename T >
constexpr bool mc_rtc::schema::details::is_std_map_v = is_std_map<T>::value
inlineconstexpr

◆ is_std_vector_schema_v

template<typename T >
constexpr bool mc_rtc::schema::details::is_std_vector_schema_v
inlineconstexpr
Initial value:
= []()
{
if constexpr(is_std_vector_v<T>) { return is_schema_v<typename T::value_type>; }
else { return false; }
}()

Type-trait to detect an std::vector<T> where T is a Schema-based type

◆ is_std_vector_v

template<typename T >
constexpr bool mc_rtc::schema::details::is_std_vector_v = is_std_vector<T>::value
inlineconstexpr