1 |
|
|
/** |
2 |
|
|
* @file RollupConfig.hpp |
3 |
|
|
* @brief Header file for blink1_control::config::RollupConfig |
4 |
|
|
*/ |
5 |
|
|
|
6 |
|
|
#pragma once |
7 |
|
|
|
8 |
|
|
#include <string> |
9 |
|
|
#include <vector> |
10 |
|
|
|
11 |
|
|
#include "config/ConditionConfig.hpp" |
12 |
|
|
|
13 |
|
|
//TODO operator<< |
14 |
|
|
|
15 |
|
|
namespace blink1_control::config { |
16 |
|
|
|
17 |
|
|
/** |
18 |
|
|
* Reference to another ConditionConfig that is used to keep track |
19 |
|
|
* of children for rollups. |
20 |
|
|
*/ |
21 |
|
|
struct RollupChild { |
22 |
|
|
/** Name of the child */ |
23 |
|
|
std::string name; |
24 |
|
|
|
25 |
|
|
/** Whether the child is considered critical (see RollupConfig) */ |
26 |
|
|
bool critical; |
27 |
|
|
}; |
28 |
|
|
|
29 |
|
|
/** |
30 |
|
|
* Configuration for rollups |
31 |
|
|
* |
32 |
|
|
* This is an extension of ConditionConfig |
33 |
|
|
* for the case where the type is ConditionConfig::Type::Rollup |
34 |
|
|
* |
35 |
|
|
* Keeps a list of children. If all children are good, runs the |
36 |
|
|
* first pattern. If only non-critical children are bad, runs |
37 |
|
|
* the second pattern. Otherwise, runs the third pattern. |
38 |
|
|
*/ |
39 |
|
|
struct RollupConfig : public ConditionConfig { |
40 |
|
|
|
41 |
|
|
/** The child conditions to combine */ |
42 |
|
|
std::vector<RollupChild> children; |
43 |
|
|
|
44 |
|
4 |
virtual ~RollupConfig() override = default; |
45 |
|
|
}; |
46 |
|
|
} |