A message field representable by a single-precision floating point value. More...
#include <command.hpp>
Public Member Functions | |
void | clear () |
Removes any currently set value for this field. More... | |
FloatField (HebiCommandPtr internal, HebiCommandFloatField field) | |
float | 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... | |
void | set (float value) |
Sets the field to a given value. More... | |
Private Attributes | |
HebiCommandFloatField const | field_ |
HebiCommandPtr const | internal_ |
A message field representable by a single-precision floating point value.
Definition at line 49 of file command.hpp.
hebi::Command::FloatField::FloatField | ( | HebiCommandPtr | internal, |
HebiCommandFloatField | field | ||
) |
Definition at line 11 of file command.cpp.
void hebi::Command::FloatField::clear | ( | ) |
Removes any currently set value for this field.
Definition at line 41 of file command.cpp.
float hebi::Command::FloatField::get | ( | ) | const |
If the field has a value, returns that value; otherwise, returns a default.
Definition at line 26 of file command.cpp.
bool hebi::Command::FloatField::has | ( | ) | const |
True if (and only if) the field has a value.
Definition at line 21 of file command.cpp.
|
explicit |
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')
Definition at line 16 of file command.cpp.
void hebi::Command::FloatField::set | ( | float | value | ) |
Sets the field to a given value.
Definition at line 36 of file command.cpp.
|
private |
Definition at line 80 of file command.hpp.
|
private |
Definition at line 79 of file command.hpp.