OSVR-Core
Public Member Functions | List of all members
osvr::util::Flag Class Reference

A class that lightly wraps a bool, in order to provide easier maintenance of a "dirty" flag, for example, with sensible default initialization and no short-circuiting. More...

#include <Flag.h>

Public Member Functions

 Flag ()
 Initialize the flag as false.
 
 operator bool () const
 Be able to test the flag in an if statement.
 
bool get () const
 Get the value of the flag as a bool.
 
void set ()
 Set the flag to true.
 
Flagoperator+= (bool newVal)
 Update the flag with (typically) a function call result: state is true if state was true or newVal is true.
 
Flagoperator+= (Flag const &rhs)
 Update the flag with another flag.
 
void reset ()
 Reset the flag back to false.
 

Detailed Description

A class that lightly wraps a bool, in order to provide easier maintenance of a "dirty" flag, for example, with sensible default initialization and no short-circuiting.


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