Zane Shelley | a61f4c5 | 2019-08-01 13:58:49 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Zane Shelley | 5a26661 | 2019-08-15 16:23:53 -0500 | [diff] [blame] | 3 | #include <hei_includes.hpp> |
Zane Shelley | 93b61ad | 2019-10-16 20:41:03 -0500 | [diff] [blame] | 4 | #include <isolator/hei_signature.hpp> |
Zane Shelley | a61f4c5 | 2019-08-01 13:58:49 -0500 | [diff] [blame] | 5 | |
| 6 | namespace libhei |
| 7 | { |
| 8 | |
| 9 | /** |
Zane Shelley | b406de4 | 2019-09-09 16:10:38 -0500 | [diff] [blame] | 10 | * @brief The main isolate() API is given a list of chips to analyze. This class |
| 11 | * will contain a list of all active hardware errors found on those |
| 12 | * chips, the contents of any registers associated with the active |
| 13 | * errors, and any other data that can be useful for debug. |
Zane Shelley | a61f4c5 | 2019-08-01 13:58:49 -0500 | [diff] [blame] | 14 | */ |
| 15 | class IsolationData |
| 16 | { |
Zane Shelley | 93b61ad | 2019-10-16 20:41:03 -0500 | [diff] [blame] | 17 | public: // Constructors, destructor, assignment, etc. |
Zane Shelley | b406de4 | 2019-09-09 16:10:38 -0500 | [diff] [blame] | 18 | /** @brief Default constructor. */ |
| 19 | IsolationData() = default; |
Zane Shelley | 5a26661 | 2019-08-15 16:23:53 -0500 | [diff] [blame] | 20 | |
| 21 | /** @brief Destructor. */ |
| 22 | ~IsolationData() = default; |
Zane Shelley | a61f4c5 | 2019-08-01 13:58:49 -0500 | [diff] [blame] | 23 | |
| 24 | /** @brief Copy constructor. */ |
Zane Shelley | fe27b65 | 2019-10-28 11:33:07 -0500 | [diff] [blame] | 25 | IsolationData(const IsolationData&) = default; |
Zane Shelley | a61f4c5 | 2019-08-01 13:58:49 -0500 | [diff] [blame] | 26 | |
| 27 | /** @brief Assignment operator. */ |
Zane Shelley | fe27b65 | 2019-10-28 11:33:07 -0500 | [diff] [blame] | 28 | IsolationData& operator=(const IsolationData&) = default; |
Zane Shelley | a61f4c5 | 2019-08-01 13:58:49 -0500 | [diff] [blame] | 29 | |
Zane Shelley | 93b61ad | 2019-10-16 20:41:03 -0500 | [diff] [blame] | 30 | private: // Instance variables |
Zane Shelley | 93b61ad | 2019-10-16 20:41:03 -0500 | [diff] [blame] | 31 | /** A list of all signatures found during isolation. */ |
| 32 | std::vector<Signature> iv_sigLists; |
Zane Shelley | a61f4c5 | 2019-08-01 13:58:49 -0500 | [diff] [blame] | 33 | |
Zane Shelley | 93b61ad | 2019-10-16 20:41:03 -0500 | [diff] [blame] | 34 | // TODO: add register dump. |
| 35 | |
| 36 | public: // Member functions |
Zane Shelley | 93b61ad | 2019-10-16 20:41:03 -0500 | [diff] [blame] | 37 | /** |
| 38 | * @brief Adds a signature to the signature list. |
| 39 | * @param i_signature The target signature. |
| 40 | */ |
Zane Shelley | fe27b65 | 2019-10-28 11:33:07 -0500 | [diff] [blame] | 41 | void addSignature(const Signature& i_signature) |
Zane Shelley | 93b61ad | 2019-10-16 20:41:03 -0500 | [diff] [blame] | 42 | { |
Zane Shelley | 83da245 | 2019-10-25 15:45:34 -0500 | [diff] [blame] | 43 | iv_sigLists.push_back(i_signature); |
Zane Shelley | 93b61ad | 2019-10-16 20:41:03 -0500 | [diff] [blame] | 44 | } |
| 45 | |
| 46 | /** @brief Allows access to the signature list. */ |
Zane Shelley | fe27b65 | 2019-10-28 11:33:07 -0500 | [diff] [blame] | 47 | const std::vector<Signature>& getSignatureList() |
Zane Shelley | 93b61ad | 2019-10-16 20:41:03 -0500 | [diff] [blame] | 48 | { |
| 49 | return iv_sigLists; |
| 50 | } |
| 51 | |
| 52 | /** @brief Flushes the data to ensure a clean slate for isolation. */ |
| 53 | void flush() |
| 54 | { |
| 55 | iv_sigLists.clear(); |
| 56 | } |
Zane Shelley | 5a26661 | 2019-08-15 16:23:53 -0500 | [diff] [blame] | 57 | |
Zane Shelley | a61f4c5 | 2019-08-01 13:58:49 -0500 | [diff] [blame] | 58 | }; // end class IsolationData |
| 59 | |
| 60 | } // end namespace libhei |