Ben Tyner | 3fb52e5 | 2020-03-31 10:10:07 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | #include <bitset> |
| 3 | |
| 4 | namespace attn |
| 5 | { |
| 6 | |
| 7 | /** @brief configuration flags */ |
| 8 | enum AttentionFlag |
| 9 | { |
Patrick Williams | 27dd636 | 2023-05-10 07:51:20 -0500 | [diff] [blame] | 10 | enVital = 0, |
| 11 | enCheckstop = 1, |
| 12 | enTerminate = 2, |
Ben Tyner | fe15649 | 2021-04-08 07:28:13 -0500 | [diff] [blame] | 13 | enBreakpoints = 3, |
Patrick Williams | 27dd636 | 2023-05-10 07:51:20 -0500 | [diff] [blame] | 14 | dfltTi = 4, |
austinfcui | d28d5f8 | 2022-04-28 16:20:39 -0500 | [diff] [blame] | 15 | enClrAttnIntr = 5, |
Ben Tyner | 3fb52e5 | 2020-03-31 10:10:07 -0500 | [diff] [blame] | 16 | lastFlag |
| 17 | }; |
| 18 | |
| 19 | /** @brief Objhects to hold configuration data */ |
| 20 | class Config |
| 21 | { |
| 22 | public: // methods |
| 23 | /** @brief Default constructor */ |
Ben Tyner | 72feadc | 2020-04-06 12:57:31 -0500 | [diff] [blame] | 24 | Config(); |
Ben Tyner | 3fb52e5 | 2020-03-31 10:10:07 -0500 | [diff] [blame] | 25 | |
| 26 | /** @brief Default destructor */ |
| 27 | ~Config() = default; |
| 28 | |
| 29 | /** @brief Get state of flag */ |
| 30 | bool getFlag(AttentionFlag i_flag) const; |
| 31 | |
| 32 | /** @brief Set configuration flag */ |
| 33 | void setFlag(AttentionFlag i_flag); |
| 34 | |
Ben Tyner | 72feadc | 2020-04-06 12:57:31 -0500 | [diff] [blame] | 35 | /** @brief Set all configuration flags */ |
| 36 | void setFlagAll(); |
| 37 | |
Ben Tyner | 3fb52e5 | 2020-03-31 10:10:07 -0500 | [diff] [blame] | 38 | /** @brief Clear configuration flag */ |
| 39 | void clearFlag(AttentionFlag i_flag); |
| 40 | |
Ben Tyner | 72feadc | 2020-04-06 12:57:31 -0500 | [diff] [blame] | 41 | /** @brief Clear all configuration flags */ |
| 42 | void clearFlagAll(); |
| 43 | |
Ben Tyner | 3fb52e5 | 2020-03-31 10:10:07 -0500 | [diff] [blame] | 44 | private: |
| 45 | std::bitset<lastFlag> iv_flags; // configuration flags |
| 46 | }; |
| 47 | |
| 48 | } // namespace attn |