blob: 0ec3241a40cb392d1291bd9ec367dfaeac2ec7c3 [file] [log] [blame]
Zane Shelleyc85716c2021-08-17 10:54:06 -05001#pragma once
2
3#include <string>
4
5namespace analyzer
6{
7
8namespace callout
9{
10
11/** @brief All callouts will have a priority indicating when to issue the
12 * required service action. */
13class Priority
14{
15 public:
16 /** Serivce is mandatory. */
17 static const Priority HIGH;
18
19 /** Serivce medium priority callouts one at a time, in order, until the
20 * issue is resolved. */
21 static const Priority MED;
22
23 /** Same as MED, except replace all A's as a group. */
24 static const Priority MED_A;
25
26 /** Same as MED, except replace all A's as a group. */
27 static const Priority MED_B;
28
29 /** Same as MED, except replace all A's as a group. */
30 static const Priority MED_C;
31
32 /** If servicing all high and medium priority callouts did not resolve
33 * the issue, service low priority callouts one at a time, in order,
34 * until the issue is resolved. */
35 static const Priority LOW;
36
37 private:
38 /**
39 * @brief Constructor from components.
40 *
41 * At the moment, the priority values for the callout list user data
42 * section are different from the priority values hard-coded in the
43 * registry. Therefore, two different values must be stored.
44 *
45 * @param i_registry The string representation of a priority used in
46 * registry callouts.
47 * @param i_userData The string representation of a priority used in user
48 * data callouts.
49 */
50 Priority(const std::string& i_registry, const std::string& i_userData) :
51 iv_registry(i_registry), iv_userData(i_userData)
52 {}
53
54 private:
55 /** The string representation of a priority used in registry callouts. */
56 const std::string iv_registry;
57
58 /** The string representation of a priority used in user data callouts. */
59 const std::string iv_userData;
60
61 public:
62 /** iv_registry accessor */
63 const std::string& getRegistryString() const
64 {
65 return iv_registry;
66 }
67
68 /** iv_userData accessor */
69 const std::string& getUserDataString() const
70 {
71 return iv_userData;
72 }
73};
74
75// clang-format off
76inline const Priority Priority::HIGH {"high", "H"};
77inline const Priority Priority::MED {"medium", "M"};
78inline const Priority Priority::MED_A{"medium_group_A","A"};
79inline const Priority Priority::MED_B{"medium_group_B","B"};
80inline const Priority Priority::MED_C{"medium_group_C","C"};
81inline const Priority Priority::LOW {"low", "L"};
82// clang-format on
83
84/** @brief Container class for procedure callout service actions. */
85class Procedure
86{
87 public:
88 /** Contact next level support. */
89 static const Procedure NEXTLVL;
90
91 private:
92 /**
93 * @brief Constructor from components.
94 * @param i_string The string representation of the procedure used for
95 * callouts.
96 */
97 explicit Procedure(const std::string& i_string) : iv_string(i_string) {}
98
99 private:
100 /** The string representation of the procedure used for callouts. */
101 const std::string iv_string;
102
103 public:
104 /** iv_string accessor */
105 std::string getString() const
106 {
107 return iv_string;
108 }
109};
110
Zane Shelley86ccc452021-11-16 13:10:52 -0600111inline const Procedure Procedure::NEXTLVL{"next_level_support"};
Zane Shelleyc85716c2021-08-17 10:54:06 -0500112
Zane Shelley5d63cef2021-09-17 18:10:17 -0500113/** @brief Container class for bus callout service actions. */
114class BusType
115{
116 public:
117 /** SMP bus (fabric A or X bus). */
118 static const BusType SMP_BUS;
119
120 /** OMI bus (memory bus). */
121 static const BusType OMI_BUS;
122
123 private:
124 /**
125 * @brief Constructor from components.
126 * @param i_string The string representation of the procedure used for
127 * callouts.
128 */
129 explicit BusType(const std::string& i_string) : iv_string(i_string) {}
130
131 private:
132 /** The string representation of the procedure used for callouts. */
133 const std::string iv_string;
134
135 public:
136 bool operator==(const BusType& r) const
137 {
138 return this->iv_string == r.iv_string;
139 }
140
141 /** iv_string accessor */
142 std::string getString() const
143 {
144 return iv_string;
145 }
146};
147
148inline const BusType BusType::SMP_BUS{"SMP_BUS"};
149inline const BusType BusType::OMI_BUS{"OMI_BUS"};
150
Zane Shelley84721d92021-09-08 13:30:27 -0500151/** @brief Container class for clock callout service actions. */
152class ClockType
153{
154 public:
155 /** Oscillator reference clock 0. */
156 static const ClockType OSC_REF_CLOCK_0;
157
158 /** Oscillator reference clock 1. */
159 static const ClockType OSC_REF_CLOCK_1;
160
Zane Shelleyd195b712022-01-26 13:26:34 -0600161 /** Time of Day (TOD) clock. */
162 static const ClockType TOD_CLOCK;
163
Zane Shelley84721d92021-09-08 13:30:27 -0500164 private:
165 /**
166 * @brief Constructor from components.
167 * @param i_string The string representation of the procedure used for
168 * callouts.
169 */
170 explicit ClockType(const std::string& i_string) : iv_string(i_string) {}
171
172 private:
173 /** The string representation of the procedure used for callouts. */
174 const std::string iv_string;
175
176 public:
177 /** iv_string accessor */
178 std::string getString() const
179 {
180 return iv_string;
181 }
182};
183
184inline const ClockType ClockType::OSC_REF_CLOCK_0{"OSC_REF_CLOCK_0"};
185inline const ClockType ClockType::OSC_REF_CLOCK_1{"OSC_REF_CLOCK_1"};
Zane Shelleyd195b712022-01-26 13:26:34 -0600186inline const ClockType ClockType::TOD_CLOCK{"TOD_CLOCK"};
Zane Shelley84721d92021-09-08 13:30:27 -0500187
Zane Shelleya4134772022-01-10 17:22:44 -0600188/** @brief Container class for part callout service actions. */
189class PartType
190{
191 public:
192 /** The part containing the PNOR. */
193 static const PartType PNOR;
194
195 private:
196 /**
197 * @brief Constructor from components.
198 * @param i_string The string representation of the part callout.
199 */
200 explicit PartType(const std::string& i_string) : iv_string(i_string) {}
201
202 private:
203 /** The string representation of the part callout. */
204 const std::string iv_string;
205
206 public:
207 bool operator==(const PartType& r) const
208 {
209 return this->iv_string == r.iv_string;
210 }
211
212 /** iv_string accessor */
213 std::string getString() const
214 {
215 return iv_string;
216 }
217};
218
219inline const PartType PartType::PNOR{"PNOR"};
220
Zane Shelleybf3326f2021-11-12 13:41:39 -0600221/** @brief Container class for guard service actions. */
222class GuardType
223{
224 public:
225 /** Do not guard. */
226 static const GuardType NONE;
227
228 /** Guard on fatal error (cannot recover resource). */
229 static const GuardType UNRECOVERABLE;
230
231 /** Guard on non-fatal error (can recover resource). */
232 static const GuardType PREDICTIVE;
233
234 private:
235 /**
236 * @brief Constructor from components.
237 * @param i_string The string representation of the procedure used for
238 * callouts.
239 */
240 explicit GuardType(const std::string& i_string) : iv_string(i_string) {}
241
242 private:
243 /** The string representation of the procedure used for callouts. */
244 const std::string iv_string;
245
246 public:
247 bool operator==(const GuardType& r) const
248 {
249 return this->iv_string == r.iv_string;
250 }
251
252 /** iv_string accessor */
253 std::string getString() const
254 {
255 return iv_string;
256 }
257};
258
259inline const GuardType GuardType::NONE{"GARD_NULL"};
260inline const GuardType GuardType::UNRECOVERABLE{"GARD_Unrecoverable"};
261inline const GuardType GuardType::PREDICTIVE{"GARD_Predictive"};
262
Zane Shelleyc85716c2021-08-17 10:54:06 -0500263} // namespace callout
264
265} // namespace analyzer