blob: 98ec3885847cd38a11aa3377801aacf91fece08a [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 Tynerfe156492021-04-08 07:28:13 -050010 iv_flags.reset(dfltTi); // 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);
austinfcuid28d5f82022-04-28 16:20:39 -050032 iv_flags.set(enClrAttnIntr);
Ben Tyner72feadc2020-04-06 12:57:31 -050033}
34
Ben Tyner3fb52e52020-03-31 10:10:07 -050035/** @brief Clear configuration flag */
36void Config::clearFlag(AttentionFlag i_flag)
37{
38 iv_flags.reset(i_flag);
39}
40
Ben Tyner72feadc2020-04-06 12:57:31 -050041/** @brief Clear all configuration flags */
42void Config::clearFlagAll()
Ben Tyner3fb52e52020-03-31 10:10:07 -050043{
Ben Tyner72feadc2020-04-06 12:57:31 -050044 iv_flags.reset(enVital);
45 iv_flags.reset(enCheckstop);
46 iv_flags.reset(enTerminate);
47 iv_flags.reset(enBreakpoints);
austinfcuid28d5f82022-04-28 16:20:39 -050048 iv_flags.reset(enClrAttnIntr);
Ben Tyner3fb52e52020-03-31 10:10:07 -050049}
50
51} // namespace attn