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 (HebiCommandPtr 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_
 
HebiCommandPtr const internal_
 

Detailed Description

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

Definition at line 252 of file command.hpp.

Constructor & Destructor Documentation

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

Definition at line 210 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 230 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 220 of file command.cpp.

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

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 215 of file command.cpp.

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

Sets this flag.

Definition at line 225 of file command.cpp.

Member Data Documentation

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

Definition at line 280 of file command.hpp.

HebiCommandPtr const hebi::Command::FlagField::internal_
private

Definition at line 279 of file command.hpp.


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


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