Public Member Functions | Private Attributes | List of all members
hebi::Command::FlagField Class Referencefinal

A two-state message field (either set/true or cleared/false). More...

#include <command.hpp>

Public Member Functions

void clear ()
 Clears this flag (e.g., sets it to false/off). More...
 
 FlagField (HebiCommandRef &internal, HebiCommandFlagField field)
 
bool has () const
 Returns true if the flag is set, false if it is cleared. More...
 
 operator bool () const
 Allows casting to a bool to check if the flag is set without directly calling has(). More...
 
void set ()
 Sets this flag. More...
 

Private Attributes

HebiCommandFlagField const field_
 
HebiCommandRefinternal_
 

Detailed Description

A two-state message field (either set/true or cleared/false).

Definition at line 267 of file command.hpp.

Constructor & Destructor Documentation

hebi::Command::FlagField::FlagField ( HebiCommandRef internal,
HebiCommandFlagField  field 
)

Definition at line 139 of file command.cpp.

Member Function Documentation

void hebi::Command::FlagField::clear ( )

Clears this flag (e.g., sets it to false/off).

Definition at line 146 of file command.cpp.

bool hebi::Command::FlagField::has ( ) const

Returns true if the flag is set, false if it is cleared.

Definition at line 142 of file command.cpp.

hebi::Command::FlagField::operator bool ( ) const
inlineexplicit

Allows casting to a bool to check if the flag is set without directly calling has().

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

Command::FlagField& 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 284 of file command.hpp.

void hebi::Command::FlagField::set ( )

Sets this flag.

Definition at line 144 of file command.cpp.

Member Data Documentation

HebiCommandFlagField const hebi::Command::FlagField::field_
private

Definition at line 295 of file command.hpp.

HebiCommandRef& hebi::Command::FlagField::internal_
private

Definition at line 294 of file command.hpp.


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


hebi_cpp_api_ros
Author(s): Chris Bollinger , Matthew Tesch
autogenerated on Thu May 28 2020 03:14:45