blob: 2633ecafb6878ef16bd8d7ed515cb20744bedd5f [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.
15
16 Chip() = default;
17
18 ~Chip() = default;
19
Zane Shelleyfe27b652019-10-28 11:33:07 -050020 Chip(const Chip&) = default;
Zane Shelleyb406de42019-09-09 16:10:38 -050021
Zane Shelleyfe27b652019-10-28 11:33:07 -050022 Chip& operator=(const Chip&) = default;
Zane Shelleyb406de42019-09-09 16:10:38 -050023
24 /**
25 * @brief Constructor.
26 * @param i_chip See description for iv_chip.
27 * @param i_type See description for iv_type.
28 */
Zane Shelley7f7a42d2019-10-28 13:28:31 -050029 Chip(void* i_chip, ChipType_t i_type) : iv_chip(i_chip), iv_type(i_type) {}
Zane Shelleyb406de42019-09-09 16:10:38 -050030
31 public: // Accessors
32
Zane Shelley7f7a42d2019-10-28 13:28:31 -050033 void* getChip() const
34 {
35 return iv_chip;
36 }
Zane Shelleyb406de42019-09-09 16:10:38 -050037
Zane Shelley7f7a42d2019-10-28 13:28:31 -050038 ChipType_t getType() const
39 {
40 return iv_type;
41 }
Zane Shelleyb406de42019-09-09 16:10:38 -050042
43 public: // Operators
44
Zane Shelleyfe27b652019-10-28 11:33:07 -050045 bool operator==(const Chip& r) const
Zane Shelleyb406de42019-09-09 16:10:38 -050046 {
Zane Shelley7f7a42d2019-10-28 13:28:31 -050047 return (iv_chip == r.iv_chip) && (iv_type == r.iv_type);
Zane Shelleyb406de42019-09-09 16:10:38 -050048 }
49
Zane Shelleyfe27b652019-10-28 11:33:07 -050050 bool operator<(const Chip& r) const
Zane Shelleyb406de42019-09-09 16:10:38 -050051 {
Zane Shelley83da2452019-10-25 15:45:34 -050052 return (iv_chip < r.iv_chip) ||
53 ((iv_chip == r.iv_chip) && (iv_type < r.iv_type));
Zane Shelleyb406de42019-09-09 16:10:38 -050054 }
55
56 private:
57
58 /**
59 * The user application will provide pointers to user application objects
60 * that represent chips targeted for analysis. The isolator does not know
61 * anything about these objects nor how to use them. The pointers' only
62 * purpose is to eventually get passed back to the user application with
63 * information associated with each chip.
64 */
Zane Shelleyfe27b652019-10-28 11:33:07 -050065 void* iv_chip = nullptr;
Zane Shelleyb406de42019-09-09 16:10:38 -050066
67 /**
68 * When doing analysis on a chip, the isolator will need to know the chip
69 * type in order to look up the correct information from the Chip Data
70 * Files.
71 */
Zane Shelley0d4f5622019-10-14 13:02:30 -050072 ChipType_t iv_type = CHIP_TYPE_INVALID;
Zane Shelleyb406de42019-09-09 16:10:38 -050073
74}; // end class Chip
75
76} // end namespace libhei