blob: b49f97bec587fb89d675a1e2a1a83eb5e59a95d7 [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
111inline const Procedure Procedure::NEXTLVL{"NEXTLVL"};
112
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
161 private:
162 /**
163 * @brief Constructor from components.
164 * @param i_string The string representation of the procedure used for
165 * callouts.
166 */
167 explicit ClockType(const std::string& i_string) : iv_string(i_string) {}
168
169 private:
170 /** The string representation of the procedure used for callouts. */
171 const std::string iv_string;
172
173 public:
174 /** iv_string accessor */
175 std::string getString() const
176 {
177 return iv_string;
178 }
179};
180
181inline const ClockType ClockType::OSC_REF_CLOCK_0{"OSC_REF_CLOCK_0"};
182inline const ClockType ClockType::OSC_REF_CLOCK_1{"OSC_REF_CLOCK_1"};
183
Zane Shelleyc85716c2021-08-17 10:54:06 -0500184} // namespace callout
185
186} // namespace analyzer