Form.h File Reference
Include dependency graph for Form.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mc_rtc::gui::details::FormElements
 
struct  mc_rtc::gui::details::FormImpl< Callback >
 
struct  mc_rtc::gui::details::is_form_element
 
struct  mc_rtc::gui::FormElement< Derived, element >
 
struct  mc_rtc::gui::details::CallbackOrValue< T >
 
struct  mc_rtc::gui::details::VoidValue
 
struct  mc_rtc::gui::details::CallbackOrValue< VoidValue >
 
struct  mc_rtc::gui::details::FormDataInputBase< T >
 
struct  mc_rtc::gui::details::FormDataInput< T, element >
 
struct  mc_rtc::gui::details::FormInteractiveDataInput< T, element >
 
struct  mc_rtc::gui::details::FormArrayInput< T >
 
struct  mc_rtc::gui::FormComboInput
 
struct  mc_rtc::gui::FormDataComboInput
 
struct  mc_rtc::gui::FormObjectInput
 
struct  mc_rtc::gui::FormGenericArrayInput< T >
 
struct  mc_rtc::gui::FormOneOfInput< T >
 

Namespaces

 mc_rtc
 
 mc_rtc::gui
 
 mc_rtc::gui::details
 

Macros

#define MAKE_DATA_INPUT_HELPER(DATAT, ELEMENT, FNAME)
 
#define MAKE_INTERACTIVE_DATA_INPUT_HELPER(DATAT, ELEMENT, FNAME)
 

Functions

template<typename T >
details::FormArrayInput< T > mc_rtc::gui::FormArrayInput (const std::string &name, bool required, bool fixed_size=false)
 
template<typename T >
auto mc_rtc::gui::FormArrayInput (const std::string &name, bool required, T &&value, bool fixed_size=true)
 
template<typename Callback , typename... Args>
auto mc_rtc::gui::Form (const std::string &name, Callback cb, Args &&... args)
 

Variables

template<typename T >
constexpr bool mc_rtc::gui::details::is_form_element_v = decltype(is_form_element::test<T>(nullptr))::value
 

Macro Definition Documentation

◆ MAKE_DATA_INPUT_HELPER

#define MAKE_DATA_INPUT_HELPER (   DATAT,
  ELEMENT,
  FNAME 
)
Value:
inline details::FormDataInput<DATAT, ELEMENT> FNAME(const std::string & name, bool required) \
{ \
return {name, required}; \
} \
\
template<typename T = DATAT> \
inline auto FNAME(const std::string & name, bool required, T value) \
{ \
if constexpr(std::is_invocable_v<T>) { return details::FormDataInput<T, ELEMENT>{name, required, value}; } \
else \
{ \
if constexpr(std::is_same_v<std::decay_t<T>, DATAT>) \
{ \
return details::FormDataInput<DATAT, ELEMENT>{name, required, value}; \
} \
else { return details::FormDataInput<DATAT, ELEMENT>{name, required, DATAT{value}}; } \
} \
}

◆ MAKE_INTERACTIVE_DATA_INPUT_HELPER

#define MAKE_INTERACTIVE_DATA_INPUT_HELPER (   DATAT,
  ELEMENT,
  FNAME 
)
Value:
inline details::FormInteractiveDataInput<DATAT, ELEMENT> FNAME(const std::string & name, bool required, \
bool interactive = true) \
{ \
return {name, required, interactive}; \
} \
\
template<typename T = DATAT, typename = std::enable_if_t<!std::is_same_v<T, bool>>> \
inline auto FNAME(const std::string & name, bool required, T value, bool interactive = true) \
{ \
if constexpr(std::is_invocable_v<T>) \
{ \
return details::FormInteractiveDataInput<T, ELEMENT>{name, required, value, interactive}; \
} \
else \
{ \
if constexpr(std::is_same_v<std::decay_t<T>, DATAT>) \
{ \
return details::FormInteractiveDataInput<DATAT, ELEMENT>{name, required, value, interactive}; \
} \
else { return details::FormInteractiveDataInput<DATAT, ELEMENT>{name, required, DATAT{value}, interactive}; } \
} \
}