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

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

#include <info.hpp>

Public Member Functions

 FlagField (const HebiInfoRef &internal, HebiInfoFlagField 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...
 

Private Attributes

HebiInfoFlagField const field_
 
const HebiInfoRefinternal_
 

Detailed Description

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

Definition at line 214 of file info.hpp.

Constructor & Destructor Documentation

hebi::Info::FlagField::FlagField ( const HebiInfoRef internal,
HebiInfoFlagField  field 
)

Definition at line 72 of file info.cpp.

Member Function Documentation

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

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

Definition at line 74 of file info.cpp.

hebi::Info::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')

Info::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 231 of file info.hpp.

Member Data Documentation

HebiInfoFlagField const hebi::Info::FlagField::field_
private

Definition at line 238 of file info.hpp.

const HebiInfoRef& hebi::Info::FlagField::internal_
private

Definition at line 237 of file info.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