blob: e2d4a72ad140c4e81e0d6b798540112d33f94e88 [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 Tyner3fb52e52020-03-31 10:10:07 -050010}
11
12/** @brief Get state of flag */
13bool Config::getFlag(AttentionFlag i_flag) const
14{
15 return (iv_flags.test(i_flag));
16}
17
18/** @brief Set configuration flag */
19void Config::setFlag(AttentionFlag i_flag)
20{
21 iv_flags.set(i_flag);
22}
23
Ben Tyner72feadc2020-04-06 12:57:31 -050024/** @brief Set all configuration flags */
25void Config::setFlagAll()
26{
27 iv_flags.set(enVital);
28 iv_flags.set(enCheckstop);
29 iv_flags.set(enTerminate);
30 iv_flags.set(enBreakpoints);
31}
32
Ben Tyner3fb52e52020-03-31 10:10:07 -050033/** @brief Clear configuration flag */
34void Config::clearFlag(AttentionFlag i_flag)
35{
36 iv_flags.reset(i_flag);
37}
38
Ben Tyner72feadc2020-04-06 12:57:31 -050039/** @brief Clear all configuration flags */
40void Config::clearFlagAll()
Ben Tyner3fb52e52020-03-31 10:10:07 -050041{
Ben Tyner72feadc2020-04-06 12:57:31 -050042 iv_flags.reset(enVital);
43 iv_flags.reset(enCheckstop);
44 iv_flags.reset(enTerminate);
45 iv_flags.reset(enBreakpoints);
Ben Tyner3fb52e52020-03-31 10:10:07 -050046}
47
48} // namespace attn