Zane Shelley | f685afd | 2021-02-15 15:39:44 -0600 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Zane Shelley | c85716c | 2021-08-17 10:54:06 -0500 | [diff] [blame] | 3 | #include <analyzer/callout.hpp> |
Zane Shelley | 8af9e46 | 2021-03-11 10:44:28 -0600 | [diff] [blame] | 4 | #include <hei_main.hpp> |
Zane Shelley | f685afd | 2021-02-15 15:39:44 -0600 | [diff] [blame] | 5 | #include <nlohmann/json.hpp> |
| 6 | |
| 7 | namespace analyzer |
| 8 | { |
| 9 | |
Zane Shelley | 64791cf | 2021-02-15 17:02:37 -0600 | [diff] [blame] | 10 | /** |
| 11 | * @brief Data regarding required service actions based on the hardware error |
| 12 | * analysis. |
| 13 | */ |
| 14 | class ServiceData |
| 15 | { |
| 16 | public: |
Zane Shelley | 8af9e46 | 2021-03-11 10:44:28 -0600 | [diff] [blame] | 17 | /** |
| 18 | * @brief Constructor from components. |
| 19 | * @param The signature of the root cause attention. |
Zane Shelley | ca49619 | 2021-08-09 12:05:52 -0500 | [diff] [blame] | 20 | * @param True if the signature list contained a system checkstop attention. |
| 21 | * False, otherwise. |
Zane Shelley | 8af9e46 | 2021-03-11 10:44:28 -0600 | [diff] [blame] | 22 | */ |
Zane Shelley | ca49619 | 2021-08-09 12:05:52 -0500 | [diff] [blame] | 23 | ServiceData(const libhei::Signature& i_rootCause, bool i_isCheckstop) : |
| 24 | iv_rootCause(i_rootCause), iv_isCheckstop(i_isCheckstop) |
Zane Shelley | 8af9e46 | 2021-03-11 10:44:28 -0600 | [diff] [blame] | 25 | {} |
Zane Shelley | 64791cf | 2021-02-15 17:02:37 -0600 | [diff] [blame] | 26 | |
| 27 | /** @brief Destructor. */ |
| 28 | ~ServiceData() = default; |
| 29 | |
| 30 | /** @brief Copy constructor. */ |
| 31 | ServiceData(const ServiceData&) = default; |
| 32 | |
| 33 | /** @brief Assignment operator. */ |
| 34 | ServiceData& operator=(const ServiceData&) = default; |
| 35 | |
| 36 | private: |
Zane Shelley | 8af9e46 | 2021-03-11 10:44:28 -0600 | [diff] [blame] | 37 | /** The signature of the root cause attention. */ |
| 38 | const libhei::Signature iv_rootCause; |
| 39 | |
Zane Shelley | ca49619 | 2021-08-09 12:05:52 -0500 | [diff] [blame] | 40 | /** True if the signature list contained a system checkstop attention. |
| 41 | * False, otherwise. */ |
| 42 | const bool iv_isCheckstop; |
| 43 | |
Zane Shelley | 64791cf | 2021-02-15 17:02:37 -0600 | [diff] [blame] | 44 | /** The list of callouts that will be added to a PEL. */ |
Zane Shelley | c85716c | 2021-08-17 10:54:06 -0500 | [diff] [blame] | 45 | nlohmann::json iv_calloutList = nlohmann::json::array(); |
Zane Shelley | 64791cf | 2021-02-15 17:02:37 -0600 | [diff] [blame] | 46 | |
Zane Shelley | 2d11432 | 2021-08-25 17:06:12 -0500 | [diff] [blame] | 47 | /** FFDC for callouts that would otherwise not be available in the |
| 48 | * callout list (unit paths, bus types, etc.). */ |
| 49 | nlohmann::json iv_calloutFFDC = nlohmann::json::array(); |
| 50 | |
Zane Shelley | 64791cf | 2021-02-15 17:02:37 -0600 | [diff] [blame] | 51 | public: |
Zane Shelley | 8af9e46 | 2021-03-11 10:44:28 -0600 | [diff] [blame] | 52 | /** @return The signature of the root cause attention. */ |
| 53 | const libhei::Signature& getRootCause() const |
| 54 | { |
| 55 | return iv_rootCause; |
| 56 | } |
| 57 | |
Zane Shelley | ca49619 | 2021-08-09 12:05:52 -0500 | [diff] [blame] | 58 | /** @return True if the signature list contained a system checkstop |
| 59 | * attention. False, otherwise. */ |
| 60 | bool queryCheckstop() const |
| 61 | { |
| 62 | return iv_isCheckstop; |
| 63 | } |
| 64 | |
Zane Shelley | c85716c | 2021-08-17 10:54:06 -0500 | [diff] [blame] | 65 | /** |
| 66 | * @brief Add callout information to the callout list. |
| 67 | * @param The JSON object for this callout. |
| 68 | */ |
Zane Shelley | 979e287 | 2021-09-20 22:46:06 -0500 | [diff] [blame] | 69 | void addCallout(const nlohmann::json& i_callout); |
Zane Shelley | 64791cf | 2021-02-15 17:02:37 -0600 | [diff] [blame] | 70 | |
Zane Shelley | 9513582 | 2021-08-23 09:00:05 -0500 | [diff] [blame] | 71 | /** |
Zane Shelley | 2d11432 | 2021-08-25 17:06:12 -0500 | [diff] [blame] | 72 | * @brief Add FFDC for a callout that would otherwise not be available in |
| 73 | * the callout list (unit paths, bus types, etc.). |
| 74 | * @param The JSON object for this callout. |
| 75 | */ |
| 76 | void addCalloutFFDC(const nlohmann::json& i_ffdc) |
| 77 | { |
| 78 | iv_calloutFFDC.push_back(i_ffdc); |
| 79 | } |
| 80 | |
Zane Shelley | c85716c | 2021-08-17 10:54:06 -0500 | [diff] [blame] | 81 | /** @brief Accessor to iv_calloutList. */ |
| 82 | const nlohmann::json& getCalloutList() const |
Zane Shelley | 64791cf | 2021-02-15 17:02:37 -0600 | [diff] [blame] | 83 | { |
Zane Shelley | c85716c | 2021-08-17 10:54:06 -0500 | [diff] [blame] | 84 | return iv_calloutList; |
Zane Shelley | 64791cf | 2021-02-15 17:02:37 -0600 | [diff] [blame] | 85 | } |
Zane Shelley | 5f6e3de | 2021-02-23 13:57:37 -0600 | [diff] [blame] | 86 | |
Zane Shelley | 2d11432 | 2021-08-25 17:06:12 -0500 | [diff] [blame] | 87 | /** @brief Accessor to iv_calloutFFDC. */ |
| 88 | const nlohmann::json& getCalloutFFDC() const |
| 89 | { |
| 90 | return iv_calloutFFDC; |
| 91 | } |
Zane Shelley | 64791cf | 2021-02-15 17:02:37 -0600 | [diff] [blame] | 92 | }; |
| 93 | |
Zane Shelley | f685afd | 2021-02-15 15:39:44 -0600 | [diff] [blame] | 94 | } // namespace analyzer |