Zane Shelley | a9b4434 | 2021-08-08 17:15:52 -0500 | [diff] [blame^] | 1 | #pragma once |
| 2 | |
| 3 | #include <analyzer/resolution.hpp> |
| 4 | #include <hei_main.hpp> |
| 5 | #include <nlohmann/json.hpp> |
| 6 | |
| 7 | #include <map> |
| 8 | |
| 9 | namespace analyzer |
| 10 | { |
| 11 | |
| 12 | /** |
| 13 | * @brief Manages the RAS data files and resolves service actions required for |
| 14 | * error signatures. |
| 15 | */ |
| 16 | class RasDataParser |
| 17 | { |
| 18 | public: |
| 19 | /** @brief Default constructor. */ |
| 20 | RasDataParser() |
| 21 | { |
| 22 | initDataFiles(); |
| 23 | } |
| 24 | |
| 25 | private: |
| 26 | /** @brief The RAS data files. */ |
| 27 | std::map<libhei::ChipType_t, nlohmann::json> iv_dataFiles; |
| 28 | |
| 29 | public: |
| 30 | /** |
| 31 | * @brief Returns a resolution for all the RAS actions needed for the given |
| 32 | * signature. |
| 33 | * @param i_signature The target error signature. |
| 34 | */ |
| 35 | std::shared_ptr<Resolution> |
| 36 | getResolution(const libhei::Signature& i_signature); |
| 37 | |
| 38 | private: |
| 39 | /** |
| 40 | * @brief Parses all of the RAS data JSON files and validates them against |
| 41 | * the associated schema. |
| 42 | */ |
| 43 | void initDataFiles(); |
| 44 | }; |
| 45 | |
| 46 | } // namespace analyzer |