HEBI C++ API  3.10.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
hebi::Feedback::LedField Class Referencefinal

A message field for interfacing with an LED. More...

#include <feedback.hpp>

Public Member Functions

 operator bool () const
 Allows casting to a bool to check if the LED color is set without directly calling hasColor(). More...
 
bool hasColor () const
 Returns true if the LED color is set, and false otherwise. More...
 
Color getColor () const
 Returns the led color. More...
 

Detailed Description

A message field for interfacing with an LED.

Member Function Documentation

◆ operator bool()

hebi::Feedback::LedField::operator bool ( ) const
inlineexplicit

Allows casting to a bool to check if the LED color is set without directly calling hasColor().

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

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

◆ hasColor()

bool hebi::Feedback::LedField::hasColor ( ) const

Returns true if the LED color is set, and false otherwise.

◆ getColor()

Color hebi::Feedback::LedField::getColor ( ) const

Returns the led color.


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