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 | a61f4c5 | 2019-08-01 13:58:49 -0500 | [diff] [blame] | 18 | |
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 | 83da245 | 2019-10-25 15:45:34 -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 | 83da245 | 2019-10-25 15:45:34 -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 | a61f4c5 | 2019-08-01 13:58:49 -0500 | [diff] [blame] | 32 | |
Zane Shelley | 93b61ad | 2019-10-16 20:41:03 -0500 | [diff] [blame] | 33 | /** A list of all signatures found during isolation. */ |
| 34 | std::vector<Signature> iv_sigLists; |
Zane Shelley | a61f4c5 | 2019-08-01 13:58:49 -0500 | [diff] [blame] | 35 | |
Zane Shelley | 93b61ad | 2019-10-16 20:41:03 -0500 | [diff] [blame] | 36 | // TODO: add register dump. |
| 37 | |
| 38 | public: // Member functions |
| 39 | |
| 40 | /** |
| 41 | * @brief Adds a signature to the signature list. |
| 42 | * @param i_signature The target signature. |
| 43 | */ |
Zane Shelley | 83da245 | 2019-10-25 15:45:34 -0500 | [diff] [blame^] | 44 | void addSignature(const Signature & i_signature) |
Zane Shelley | 93b61ad | 2019-10-16 20:41:03 -0500 | [diff] [blame] | 45 | { |
Zane Shelley | 83da245 | 2019-10-25 15:45:34 -0500 | [diff] [blame^] | 46 | iv_sigLists.push_back(i_signature); |
Zane Shelley | 93b61ad | 2019-10-16 20:41:03 -0500 | [diff] [blame] | 47 | } |
| 48 | |
| 49 | /** @brief Allows access to the signature list. */ |
| 50 | const std::vector<Signature> & getSignatureList() |
| 51 | { |
| 52 | return iv_sigLists; |
| 53 | } |
| 54 | |
| 55 | /** @brief Flushes the data to ensure a clean slate for isolation. */ |
| 56 | void flush() |
| 57 | { |
| 58 | iv_sigLists.clear(); |
| 59 | } |
Zane Shelley | 5a26661 | 2019-08-15 16:23:53 -0500 | [diff] [blame] | 60 | |
Zane Shelley | a61f4c5 | 2019-08-01 13:58:49 -0500 | [diff] [blame] | 61 | }; // end class IsolationData |
| 62 | |
| 63 | } // end namespace libhei |