Class BoolState

Class Documentation

class BoolState

automatically set/clear a boolean

This is a utility class to automatically set and clear a boolean for the duration of a limited scope. You supply the atomic bool variable and construct this class with a reference to that variable and the bool state is set (true). When the class goes out of scope the destructor will clear the bool state (false).

Public Functions

inline BoolState(std::atomic<bool> &state_var)
inline ~BoolState()