blob: 394f51ce6f2ca0f0365c17ba64b4e3677cc54139 [file] [log] [blame]
#pragma once
#include <hei_types.hpp>
namespace libhei
{
/**
* @brief This is a simple container for pointers to the user application chip
* objects and the associated chip type.
*/
class Chip
{
public: // Constructors, destructors, assignment, etc.
Chip() = default;
~Chip() = default;
Chip( const Chip & ) = default;
Chip & operator=( const Chip & ) = default;
/**
* @brief Constructor.
* @param i_chip See description for iv_chip.
* @param i_type See description for iv_type.
*/
Chip( void * i_chip, ChipType_t i_type ) :
iv_chip(i_chip), iv_type(i_type)
{}
public: // Accessors
void * getChip() const { return iv_chip; }
ChipType_t getType() const { return iv_type; }
public: // Operators
bool operator==( const Chip & r ) const
{
return (iv_chip == r.iv_chip) &&
(iv_type == r.iv_type);
}
bool operator<( const Chip & r ) const
{
return ( iv_chip < r.iv_chip ) ||
( (iv_chip == r.iv_chip) &&
(iv_type < r.iv_type) );
}
private:
/**
* The user application will provide pointers to user application objects
* that represent chips targeted for analysis. The isolator does not know
* anything about these objects nor how to use them. The pointers' only
* purpose is to eventually get passed back to the user application with
* information associated with each chip.
*/
void * iv_chip = nullptr;
/**
* When doing analysis on a chip, the isolator will need to know the chip
* type in order to look up the correct information from the Chip Data
* Files.
*/
ChipType_t iv_type = DEFAULT_CHIP_TYPE;
}; // end class Chip
} // end namespace libhei