blob: 20b0b8c7b5006795cf81099627493eabf684ce9d [file] [log] [blame]
Zane Shelleyb406de42019-09-09 16:10:38 -05001#pragma once
2
3#include <hei_types.hpp>
4
5namespace libhei
6{
7
8/**
9 * @brief This is a simple container for pointers to the user application chip
10 * objects and the associated chip type.
11 */
12class Chip
13{
14 public: // Constructors, destructors, assignment, etc.
Zane Shelleyb406de42019-09-09 16:10:38 -050015 /**
16 * @brief Constructor.
17 * @param i_chip See description for iv_chip.
18 * @param i_type See description for iv_type.
19 */
Zane Shelley11b89942019-11-07 11:07:28 -060020 Chip(const void* i_chip, ChipType_t i_type) :
21 iv_chip(i_chip), iv_type(i_type)
22 {}
Zane Shelleyb406de42019-09-09 16:10:38 -050023
Zane Shelley8c093d82020-05-04 22:06:52 -050024 ~Chip() = default;
25
26 Chip(const Chip&) = default;
27
28 Chip& operator=(const Chip&) = default;
29
Zane Shelleyb406de42019-09-09 16:10:38 -050030 public: // Accessors
Zane Shelley11b89942019-11-07 11:07:28 -060031 const void* getChip() const
Zane Shelley7f7a42d2019-10-28 13:28:31 -050032 {
33 return iv_chip;
34 }
Zane Shelleyb406de42019-09-09 16:10:38 -050035
Zane Shelley7f7a42d2019-10-28 13:28:31 -050036 ChipType_t getType() const
37 {
38 return iv_type;
39 }
Zane Shelleyb406de42019-09-09 16:10:38 -050040
41 public: // Operators
Zane Shelleyfe27b652019-10-28 11:33:07 -050042 bool operator==(const Chip& r) const
Zane Shelleyb406de42019-09-09 16:10:38 -050043 {
Zane Shelley7f7a42d2019-10-28 13:28:31 -050044 return (iv_chip == r.iv_chip) && (iv_type == r.iv_type);
Zane Shelleyb406de42019-09-09 16:10:38 -050045 }
46
Zane Shelleyfe27b652019-10-28 11:33:07 -050047 bool operator<(const Chip& r) const
Zane Shelleyb406de42019-09-09 16:10:38 -050048 {
Zane Shelley83da2452019-10-25 15:45:34 -050049 return (iv_chip < r.iv_chip) ||
50 ((iv_chip == r.iv_chip) && (iv_type < r.iv_type));
Zane Shelleyb406de42019-09-09 16:10:38 -050051 }
52
53 private:
Zane Shelleyb406de42019-09-09 16:10:38 -050054 /**
55 * The user application will provide pointers to user application objects
56 * that represent chips targeted for analysis. The isolator does not know
57 * anything about these objects nor how to use them. The pointers' only
58 * purpose is to eventually get passed back to the user application with
59 * information associated with each chip.
60 */
Zane Shelley8c093d82020-05-04 22:06:52 -050061 const void* iv_chip;
Zane Shelleyb406de42019-09-09 16:10:38 -050062
63 /**
64 * When doing analysis on a chip, the isolator will need to know the chip
65 * type in order to look up the correct information from the Chip Data
66 * Files.
67 */
Zane Shelley8c093d82020-05-04 22:06:52 -050068 ChipType_t iv_type;
Zane Shelleyb406de42019-09-09 16:10:38 -050069
70}; // end class Chip
71
72} // end namespace libhei