blob: e484167a5f65f5ea3805484964e44d6f2a869181 [file] [log] [blame]
Zane Shelleya9b44342021-08-08 17:15:52 -05001#pragma once
2
3#include <analyzer/resolution.hpp>
4#include <hei_main.hpp>
5#include <nlohmann/json.hpp>
6
7#include <map>
8
9namespace analyzer
10{
11
12/**
13 * @brief Manages the RAS data files and resolves service actions required for
14 * error signatures.
15 */
16class 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