1 #pragma once 2 #include <bitset> 3 4 namespace attn 5 { 6 7 /** @brief configuration flags */ 8 enum 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 */ 18 class Config 19 { 20 public: // methods 21 /** @brief Default constructor */ 22 Config(); 23 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 33 /** @brief Set all configuration flags */ 34 void setFlagAll(); 35 36 /** @brief Clear configuration flag */ 37 void clearFlag(AttentionFlag i_flag); 38 39 /** @brief Clear all configuration flags */ 40 void clearFlagAll(); 41 42 /** @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 51