blob: 6ab6e19d5d09f89ae1f3ad931387a7a895f15186 [file] [log] [blame]
Ben Tyner3fb52e52020-03-31 10:10:07 -05001#include <attn/attn_config.hpp>
2
3namespace attn
4{
5
6/** @brief Main constructor */
Ben Tyner72feadc2020-04-06 12:57:31 -05007Config::Config()
Ben Tyner3fb52e52020-03-31 10:10:07 -05008{
Ben Tyner72feadc2020-04-06 12:57:31 -05009 setFlagAll();
Ben Tynere4f5dbe2020-10-19 07:19:33 -050010 iv_flags.reset(dfltBreakpoint); // default value is clear
Ben Tyner3fb52e52020-03-31 10:10:07 -050011}
12
13/** @brief Get state of flag */
14bool Config::getFlag(AttentionFlag i_flag) const
15{
16 return (iv_flags.test(i_flag));
17}
18
19/** @brief Set configuration flag */
20void Config::setFlag(AttentionFlag i_flag)
21{
22 iv_flags.set(i_flag);
23}
24
Ben Tyner72feadc2020-04-06 12:57:31 -050025/** @brief Set all configuration flags */
26void Config::setFlagAll()
27{
28 iv_flags.set(enVital);
29 iv_flags.set(enCheckstop);
30 iv_flags.set(enTerminate);
31 iv_flags.set(enBreakpoints);
32}
33
Ben Tyner3fb52e52020-03-31 10:10:07 -050034/** @brief Clear configuration flag */
35void Config::clearFlag(AttentionFlag i_flag)
36{
37 iv_flags.reset(i_flag);
38}
39
Ben Tyner72feadc2020-04-06 12:57:31 -050040/** @brief Clear all configuration flags */
41void Config::clearFlagAll()
Ben Tyner3fb52e52020-03-31 10:10:07 -050042{
Ben Tyner72feadc2020-04-06 12:57:31 -050043 iv_flags.reset(enVital);
44 iv_flags.reset(enCheckstop);
45 iv_flags.reset(enTerminate);
46 iv_flags.reset(enBreakpoints);
Ben Tyner3fb52e52020-03-31 10:10:07 -050047}
48
49} // namespace attn