Reduces headers needed for external includes
hei_main.hpp included hei_isolator.hpp, which requires nearly all
headers in this project to be exported when building a library.
Change-Id: I6013ab53a7ee2b4993526bc4c62b30e8bf5f6702
Signed-off-by: Zane Shelley <zshelle@us.ibm.com>
diff --git a/src/isolator/hei_isolator.cpp b/src/isolator/hei_isolator.cpp
index 327da54..dc4d09b 100644
--- a/src/isolator/hei_isolator.cpp
+++ b/src/isolator/hei_isolator.cpp
@@ -1,4 +1,5 @@
+#include <hei_includes.hpp>
#include <isolator/hei_isolation_node.hpp>
#include <isolator/hei_isolator.hpp>
#include <register/hei_hardware_register.hpp>
@@ -13,6 +14,27 @@
namespace libhei
{
+//------------------------------------------------------------------------------
+
+// Definitions for the interfaces defined in hei_main.hpp.
+
+void initialize(void* i_buffer, size_t i_bufferSize)
+{
+ Isolator::getSingleton().initialize(i_buffer, i_bufferSize);
+}
+
+void uninitialize()
+{
+ Isolator::getSingleton().uninitialize();
+}
+
+void isolate(const std::vector<Chip>& i_chipList, IsolationData& o_isoData)
+{
+ Isolator::getSingleton().isolate(i_chipList, o_isoData);
+}
+
+//------------------------------------------------------------------------------
+
void Isolator::initialize(void* i_buffer, size_t i_bufferSize)
{
// TODO
diff --git a/src/isolator/hei_signature.hpp b/src/isolator/hei_signature.hpp
deleted file mode 100644
index 2bf91e1..0000000
--- a/src/isolator/hei_signature.hpp
+++ /dev/null
@@ -1,128 +0,0 @@
-#pragma once
-
-#include <hei_includes.hpp>
-
-namespace libhei
-{
-
-/**
- * @brief A signature represents an active attention from a single bit on a
- * register within a chip.
- *
- * The isolator will gather a list of all active attentions on a chip and return
- * a list of signatures to the user application. The user application should be
- * able to determine what actions to take based on these signatures.
- */
-class Signature
-{
- public: // Constructors, destructor, assignment, etc.
- /**
- * @brief Constructor from components.
- * @param i_chip The chip containing this register.
- * @param i_id The register ID.
- * @param i_instance The instance of this register.
- * @param i_bit The target bit within this register.
- * @param i_attnType The attention type reported by this bit.
- */
- Signature(const Chip& i_chip, RegisterId_t i_id,
- RegisterInstance_t i_instance, RegisterBit_t i_bit,
- AttentionType_t i_attnType) :
- iv_chip(i_chip),
- iv_id(i_id), iv_instance(i_instance), iv_bit(i_bit),
- iv_attnType(i_attnType)
- {}
-
- /** @brief Destructor. */
- ~Signature() = default;
-
- /** @brief Copy constructor. */
- Signature(const Signature&) = default;
-
- /** @brief Assignment operator. */
- Signature& operator=(const Signature&) = default;
-
- private:
- Chip iv_chip; ///< Chip containing this register.
- RegisterId_t iv_id; ///< Register ID.
- RegisterInstance_t iv_instance; ///< Instance of this register.
- RegisterBit_t iv_bit; ///< Target bit within this register.
- AttentionType_t iv_attnType; ///< Attention type reported by this bit.
-
- public: // Member functions
- /** @return The chip containing this register. */
- const Chip& getChip() const
- {
- return iv_chip;
- }
-
- /** @return The register ID. */
- RegisterId_t getId() const
- {
- return iv_id;
- }
-
- /** @return The instance of this register. */
- RegisterInstance_t getInstance() const
- {
- return iv_instance;
- }
-
- /** @return The target bit within this register. */
- RegisterBit_t getBit() const
- {
- return iv_bit;
- }
-
- /** @return The attention type reported by this bit. */
- AttentionType_t getAttnType() const
- {
- return iv_attnType;
- }
-
- public: // Operators
- /** @brief Equals operator. */
- bool operator==(const Signature& i_r) const
- {
- return (getChip() == i_r.getChip() && getId() == i_r.getId() &&
- getInstance() == i_r.getInstance() &&
- getBit() == i_r.getBit() && getAttnType() == i_r.getAttnType());
- }
-
- /** @brief Less than operator. */
- bool operator<(const Signature& i_r) const
- {
- if (getChip() < i_r.getChip())
- {
- return true;
- }
- else if (getChip() == i_r.getChip())
- {
- if (getId() < i_r.getId())
- {
- return true;
- }
- else if (getId() == i_r.getId())
- {
- if (getInstance() < i_r.getInstance())
- {
- return true;
- }
- else if (getInstance() == i_r.getInstance())
- {
- if (getBit() < i_r.getBit())
- {
- return true;
- }
- else if (getBit() == i_r.getBit())
- {
- return (getAttnType() < i_r.getAttnType());
- }
- }
- }
- }
-
- return false;
- }
-};
-
-} // end namespace libhei