blob: e8ef1011e2e0bc5de6e2ad7d2b42ca711d22e833 [file] [log] [blame]
Ben Tyner3fb52e52020-03-31 10:10:07 -05001#pragma once
2#include <bitset>
3
4namespace attn
5{
6
7/** @brief configuration flags */
8enum AttentionFlag
9{
Ben Tynere4f5dbe2020-10-19 07:19:33 -050010 enVital = 0,
11 enCheckstop = 1,
12 enTerminate = 2,
13 enBreakpoints = 3,
14 dfltBreakpoint = 4,
Ben Tyner3fb52e52020-03-31 10:10:07 -050015 lastFlag
16};
17
18/** @brief Objhects to hold configuration data */
19class Config
20{
21 public: // methods
22 /** @brief Default constructor */
Ben Tyner72feadc2020-04-06 12:57:31 -050023 Config();
Ben Tyner3fb52e52020-03-31 10:10:07 -050024
25 /** @brief Default destructor */
26 ~Config() = default;
27
28 /** @brief Get state of flag */
29 bool getFlag(AttentionFlag i_flag) const;
30
31 /** @brief Set configuration flag */
32 void setFlag(AttentionFlag i_flag);
33
Ben Tyner72feadc2020-04-06 12:57:31 -050034 /** @brief Set all configuration flags */
35 void setFlagAll();
36
Ben Tyner3fb52e52020-03-31 10:10:07 -050037 /** @brief Clear configuration flag */
38 void clearFlag(AttentionFlag i_flag);
39
Ben Tyner72feadc2020-04-06 12:57:31 -050040 /** @brief Clear all configuration flags */
41 void clearFlagAll();
42
Ben Tyner3fb52e52020-03-31 10:10:07 -050043 /** @brief Set state of all configuration data */
44 void setConfig(bool i_vital, bool i_checkstop, bool i_terminate,
45 bool i_breakpoints);
46
47 private:
48 std::bitset<lastFlag> iv_flags; // configuration flags
49};
50
51} // namespace attn