Krotos Modules 3
Loading...
Searching...
No Matches
krotos::MonitoredBool Class Reference

A bool which is monitored for changes of state. More...

#include <HelperClasses.h>

Public Member Functions

bool & operator= (const bool &newVal)
 
bool getVal () const
 
bool hasChanged ()
 

Private Attributes

bool m_changed {false}
 
bool m_val {false}
 

Detailed Description

A bool which is monitored for changes of state.

Provides the functionality of a bool, but with the added feature that it can be queried to see whether the most recent assignment changed its state

Member Function Documentation

◆ getVal()

bool krotos::MonitoredBool::getVal ( ) const
inline

Get the value.

◆ hasChanged()

bool krotos::MonitoredBool::hasChanged ( )
inline

Query to see if the value changed on the most recent assignment.

◆ operator=()

bool & krotos::MonitoredBool::operator= ( const bool & newVal)
inline

Set the value.

Member Data Documentation

◆ m_changed

bool krotos::MonitoredBool::m_changed {false}
private

◆ m_val

bool krotos::MonitoredBool::m_val {false}
private

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