blob: 32f885e5839212217c8d5e63cbf1d1da69e6d376 [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{
10 enVital = 0,
11 enCheckstop = 1,
12 enTerminate = 2,
13 enBreakpoints = 3,
14 lastFlag
15};
16
17/** @brief Objhects to hold configuration data */
18class Config
19{
20 public: // methods
21 /** @brief Default constructor */
Ben Tyner72feadc2020-04-06 12:57:31 -050022 Config();
Ben Tyner3fb52e52020-03-31 10:10:07 -050023
24 /** @brief Default destructor */
25 ~Config() = default;
26
27 /** @brief Get state of flag */
28 bool getFlag(AttentionFlag i_flag) const;
29
30 /** @brief Set configuration flag */
31 void setFlag(AttentionFlag i_flag);
32
Ben Tyner72feadc2020-04-06 12:57:31 -050033 /** @brief Set all configuration flags */
34 void setFlagAll();
35
Ben Tyner3fb52e52020-03-31 10:10:07 -050036 /** @brief Clear configuration flag */
37 void clearFlag(AttentionFlag i_flag);
38
Ben Tyner72feadc2020-04-06 12:57:31 -050039 /** @brief Clear all configuration flags */
40 void clearFlagAll();
41
Ben Tyner3fb52e52020-03-31 10:10:07 -050042 /** @brief Set state of all configuration data */
43 void setConfig(bool i_vital, bool i_checkstop, bool i_terminate,
44 bool i_breakpoints);
45
46 private:
47 std::bitset<lastFlag> iv_flags; // configuration flags
48};
49
50} // namespace attn