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

Detailed Description

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

Definition at line 197 of file info.hpp.

Constructor & Destructor Documentation

hebi::Info::FlagField::FlagField ( HebiInfoPtr  internal,
HebiInfoFlagField  field 
)

Definition at line 118 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 128 of file info.cpp.

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

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 123 of file info.cpp.

Member Data Documentation

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

Definition at line 221 of file info.hpp.

HebiInfoPtr const hebi::Info::FlagField::internal_
private

Definition at line 220 of file info.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:11:00