HoverRace  2.0
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
HoverRace::Display::RadioGroup< T > Class Template Reference

A group of radio buttons. More...

#include <RadioButton.h>

Public Types

using button_t = RadioButton< T >
 
using valueChangedSignal_t = boost::signals2::signal< void()>
 

Public Member Functions

 RadioGroup ()
 
void Add (std::shared_ptr< button_t > button)
 Add a radio button to the group. More...
 
const T & GetValue () const
 
valueChangedSignal_tGetValueChangedSignal ()
 
void SetValue (const T &val)
 Set the selected radio button by value. More...
 

Private Member Functions

void SetSelectedButton (button_t *sel)
 

Private Attributes

std::vector< std::shared_ptr< button_t > > buttons
 
std::vector< std::unique_ptr< boost::signals2::scoped_connection > > clickedConns
 
button_tselButton
 
valueChangedSignal_t valueChangedSignal
 

Detailed Description

template<class T>
class HoverRace::Display::RadioGroup< T >

A group of radio buttons.

Template Parameters
TThe type of the values held by the radio buttons.
Author
Michael Imamura

Member Typedef Documentation

template<class T>
using HoverRace::Display::RadioGroup< T >::button_t = RadioButton<T>
template<class T>
using HoverRace::Display::RadioGroup< T >::valueChangedSignal_t = boost::signals2::signal<void()>

Constructor & Destructor Documentation

template<class T>
HoverRace::Display::RadioGroup< T >::RadioGroup ( )
inline

Member Function Documentation

template<class T>
void HoverRace::Display::RadioGroup< T >::Add ( std::shared_ptr< button_t button)
inline

Add a radio button to the group.

Parameters
buttonThe button to add (may not be nullptr).
template<class T>
const T& HoverRace::Display::RadioGroup< T >::GetValue ( ) const
inline
template<class T>
valueChangedSignal_t& HoverRace::Display::RadioGroup< T >::GetValueChangedSignal ( )
inline
template<class T>
void HoverRace::Display::RadioGroup< T >::SetSelectedButton ( button_t sel)
inlineprivate
template<class T>
void HoverRace::Display::RadioGroup< T >::SetValue ( const T &  val)
inline

Set the selected radio button by value.

If none of the radio buttons in this group match the value, then the selection will stay unchanged.

Parameters
valThe value.

Member Data Documentation

template<class T>
std::vector<std::shared_ptr<button_t> > HoverRace::Display::RadioGroup< T >::buttons
private
template<class T>
std::vector<std::unique_ptr<boost::signals2::scoped_connection> > HoverRace::Display::RadioGroup< T >::clickedConns
private
template<class T>
button_t* HoverRace::Display::RadioGroup< T >::selButton
private
template<class T>
valueChangedSignal_t HoverRace::Display::RadioGroup< T >::valueChangedSignal
private

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