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