Public Member Functions | Private Attributes | List of all members
hebi::Feedback::EnumField< T > Class Template Referencefinal

A message field representable by an enum of a given type. More...

#include <feedback.hpp>

Public Member Functions

 EnumField (HebiFeedbackPtr internal, HebiFeedbackEnumField field)
 
get () const
 If the field has a value, returns that value; otherwise, returns a default. More...
 
bool has () const
 True if (and only if) the field has a value. More...
 
 operator bool () const
 Allows casting to a bool to check if the field has a value without directly calling has(). More...
 

Private Attributes

HebiFeedbackEnumField const field_
 
HebiFeedbackPtr const internal_
 

Detailed Description

template<typename T>
class hebi::Feedback::EnumField< T >

A message field representable by an enum of a given type.

Definition at line 326 of file feedback.hpp.

Constructor & Destructor Documentation

template<typename T>
hebi::Feedback::EnumField< T >::EnumField ( HebiFeedbackPtr  internal,
HebiFeedbackEnumField< T >  field 
)
inline

Definition at line 330 of file feedback.hpp.

Member Function Documentation

template<typename T>
T hebi::Feedback::EnumField< T >::get ( ) const
inline

If the field has a value, returns that value; otherwise, returns a default.

Definition at line 350 of file feedback.hpp.

template<typename T>
bool hebi::Feedback::EnumField< T >::has ( ) const
inline

True if (and only if) the field has a value.

Definition at line 347 of file feedback.hpp.

template<typename T>
hebi::Feedback::EnumField< T >::operator bool ( ) const
inlineexplicit

Allows casting to a bool to check if the field has a value without directly calling has().

This can be used as in the following (assuming 'parent' is a parent message, and this field is called 'myField')

Feedback::EnumField& f = parent.myField();
if (f)
std::cout << "Field has value: " << f.get() << std::endl;
else
std::cout << "Field has no value!" << std::endl;

Definition at line 345 of file feedback.hpp.

Member Data Documentation

template<typename T>
HebiFeedbackEnumField const hebi::Feedback::EnumField< T >::field_
private

Definition at line 354 of file feedback.hpp.

template<typename T>
HebiFeedbackPtr const hebi::Feedback::EnumField< T >::internal_
private

Definition at line 353 of file feedback.hpp.


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


hebiros
Author(s): Xavier Artache , Matthew Tesch
autogenerated on Thu Sep 3 2020 04:10:59