Zane Shelley | c85716c | 2021-08-17 10:54:06 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <string> |
| 4 | |
| 5 | namespace analyzer |
| 6 | { |
| 7 | |
| 8 | namespace callout |
| 9 | { |
| 10 | |
| 11 | /** @brief All callouts will have a priority indicating when to issue the |
| 12 | * required service action. */ |
| 13 | class 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 |
| 76 | inline const Priority Priority::HIGH {"high", "H"}; |
| 77 | inline const Priority Priority::MED {"medium", "M"}; |
| 78 | inline const Priority Priority::MED_A{"medium_group_A","A"}; |
| 79 | inline const Priority Priority::MED_B{"medium_group_B","B"}; |
| 80 | inline const Priority Priority::MED_C{"medium_group_C","C"}; |
| 81 | inline const Priority Priority::LOW {"low", "L"}; |
| 82 | // clang-format on |
| 83 | |
| 84 | /** @brief Container class for procedure callout service actions. */ |
| 85 | class 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 | |
| 111 | inline const Procedure Procedure::NEXTLVL{"NEXTLVL"}; |
| 112 | |
| 113 | } // namespace callout |
| 114 | |
| 115 | } // namespace analyzer |