A class to handle a boolean flag.
More...
#include <C_flag.hpp>
|
constexpr | BooleanFlag (bool defaultValue=false) |
constexpr bool | check (bool input) |
| Check the input and return the flag value.
|
constexpr void | set (bool value) |
| Manually set the flag value.
|
constexpr bool | get () const |
| Get the flag value.
|
constexpr bool | operator= (bool value) |
| Manually set the flag value operator.
|
constexpr | operator bool () const |
| Get the flag value operator.
|
A class to handle a boolean flag.
A flag becomes true only once when the input is held true and then waits for the input to return to false before being set again.
◆ check()
bool fge::BooleanFlag::check |
( |
bool | input | ) |
|
|
inlineconstexpr |
Check the input and return the flag value.
This function will only return true once, and wait for the input to return false before being set again.
- Parameters
-
input | The boolean input to check |
- Returns
- The flag value
◆ get()
bool fge::BooleanFlag::get |
( |
| ) |
const |
|
inlinenodiscardconstexpr |
Get the flag value.
- Returns
- The flag value
◆ operator bool()
fge::BooleanFlag::operator bool |
( |
| ) |
const |
|
inlineconstexpr |
Get the flag value operator.
- Returns
- The flag value
◆ operator=()
bool fge::BooleanFlag::operator= |
( |
bool | value | ) |
|
|
inlineconstexpr |
Manually set the flag value operator.
- Parameters
-
value | The boolean value to set |
- Returns
- The flag value
◆ set()
void fge::BooleanFlag::set |
( |
bool | value | ) |
|
|
inlineconstexpr |
Manually set the flag value.
- Parameters
-
value | The boolean value to set |
The documentation for this class was generated from the following file: