mc_rtc::gui::FormOneOfInput< T > Struct Template Reference

#include <mc_rtc/gui/Form.h>

Inheritance diagram for mc_rtc::gui::FormOneOfInput< T >:
Collaboration diagram for mc_rtc::gui::FormOneOfInput< T >:

Public Member Functions

 FormOneOfInput (const std::string &name, bool required)
 
template<typename U , typename... Args, typename = std::enable_if_t<!details::is_variant_v<std::decay_t<U>> && !details::is_getter<U>()>>
 FormOneOfInput (const std::string &name, bool required, U &&arg, Args &&... args)
 
template<typename... Args>
 FormOneOfInput (const std::string &name, bool required, const T &def, Args &&... args)
 
void write_ (mc_rtc::MessagePackBuilder &builder)
 
- Public Member Functions inherited from mc_rtc::gui::FormElement< FormOneOfInput< details::VoidValue >, Elements::OneOf >
void write (mc_rtc::MessagePackBuilder &builder)
 
 FormElement ()
 
- Public Member Functions inherited from mc_rtc::gui::details::FormElements
template<typename... Args>
 FormElements (Args &&... args)
 
template<typename T >
void addElement (T &&element)
 
void write_impl (mc_rtc::MessagePackBuilder &builder)
 

Static Public Member Functions

static constexpr bool is_dynamic ()
 
static constexpr size_t write_size_ ()
 
- Static Public Member Functions inherited from mc_rtc::gui::FormElement< FormOneOfInput< details::VoidValue >, Elements::OneOf >
static constexpr size_t write_size ()
 
static constexpr bool is_dynamic ()
 

Additional Inherited Members

- Public Types inherited from mc_rtc::gui::FormElement< FormOneOfInput< details::VoidValue >, Elements::OneOf >
using is_form_element_t = std::true_type
 
- Static Public Attributes inherited from mc_rtc::gui::FormElement< FormOneOfInput< details::VoidValue >, Elements::OneOf >
static constexpr auto type
 
- Protected Member Functions inherited from mc_rtc::gui::FormElement< FormOneOfInput< details::VoidValue >, Elements::OneOf >
 FormElement (const std::string &name, bool required)
 
- Protected Member Functions inherited from mc_rtc::gui::details::FormElements
template<typename... Args>
void write_elements (mc_rtc::MessagePackBuilder &, Args &&...)
 
template<typename Arg , typename... Args>
void write_elements (mc_rtc::MessagePackBuilder &builder, Arg &&element, Args &&... args)
 
template<typename T >
void addDynamicElement (T &&element)
 
- Protected Attributes inherited from mc_rtc::gui::FormElement< FormOneOfInput< details::VoidValue >, Elements::OneOf >
std::string name_
 
bool required_
 
- Protected Attributes inherited from mc_rtc::gui::details::FormElements
size_t count_
 
std::vector< std::function< void(mc_rtc::MessagePackBuilder &)> > dynamic_elements_
 
std::vector< char > data_
 
size_t data_size_
 

Detailed Description

template<typename T = details::VoidValue>
struct mc_rtc::gui::FormOneOfInput< T >

Creates a one-of selector

Only one of the item provided to this input will be active

The value is sent as a variant, i.e. [selected_index, value]

A default value (of a variant type) can be provided

If required, one of the element must be selected

Constructor & Destructor Documentation

◆ FormOneOfInput() [1/3]

template<typename T = details::VoidValue>
mc_rtc::gui::FormOneOfInput< T >::FormOneOfInput ( const std::string &  name,
bool  required 
)
inline

◆ FormOneOfInput() [2/3]

template<typename T = details::VoidValue>
template<typename U , typename... Args, typename = std::enable_if_t<!details::is_variant_v<std::decay_t<U>> && !details::is_getter<U>()>>
mc_rtc::gui::FormOneOfInput< T >::FormOneOfInput ( const std::string &  name,
bool  required,
U &&  arg,
Args &&...  args 
)
inline

◆ FormOneOfInput() [3/3]

template<typename T = details::VoidValue>
template<typename... Args>
mc_rtc::gui::FormOneOfInput< T >::FormOneOfInput ( const std::string &  name,
bool  required,
const T &  def,
Args &&...  args 
)
inline

Member Function Documentation

◆ is_dynamic()

template<typename T = details::VoidValue>
static constexpr bool mc_rtc::gui::FormOneOfInput< T >::is_dynamic ( )
inlinestaticconstexpr

◆ write_()

template<typename T = details::VoidValue>
void mc_rtc::gui::FormOneOfInput< T >::write_ ( mc_rtc::MessagePackBuilder builder)
inline

◆ write_size_()

template<typename T = details::VoidValue>
static constexpr size_t mc_rtc::gui::FormOneOfInput< T >::write_size_ ( )
inlinestaticconstexpr

The documentation for this struct was generated from the following file: