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/meson.build b/meson.build
index 31964ec..db4e378 100644
--- a/meson.build
+++ b/meson.build
@@ -23,29 +23,15 @@
dependencies: libhei_dep,
install: true)
-install_headers('src/hei_chip.hpp',
- 'src/hei_includes.hpp',
- 'src/hei_isolation_data.hpp',
- 'src/hei_macros.hpp',
- 'src/hei_main.hpp',
- 'src/hei_types.hpp',
- 'src/hei_user_interface.hpp',
- subdir : 'libhei')
-
-install_headers('src/isolator/hei_signature.hpp',
- 'src/isolator/hei_isolator.hpp',
- 'src/isolator/hei_isolation_node.hpp',
- subdir : 'libhei/isolator')
-
-install_headers('src/register/hei_hardware_register.hpp',
- 'src/register/hei_operator_register.hpp',
- 'src/register/hei_scom_register.hpp',
- 'src/register/hei_register.hpp',
- subdir : 'libhei/register')
-
-install_headers('src/util/hei_bit_string.hpp',
- 'src/util/hei_flyweight.hpp',
- subdir : 'libhei/util')
+install_headers(
+ 'src/hei_chip.hpp',
+ 'src/hei_isolation_data.hpp',
+ 'src/hei_main.hpp',
+ 'src/hei_signature.hpp',
+ 'src/hei_types.hpp',
+ 'src/hei_user_interface.hpp',
+ subdir : 'libhei'
+)
pkg_mod = import('pkgconfig')
diff --git a/src/hei_isolation_data.hpp b/src/hei_isolation_data.hpp
index b9a3b75..df07e05 100644
--- a/src/hei_isolation_data.hpp
+++ b/src/hei_isolation_data.hpp
@@ -1,7 +1,8 @@
#pragma once
-#include <hei_includes.hpp>
-#include <isolator/hei_signature.hpp>
+#include <hei_signature.hpp>
+
+#include <vector>
namespace libhei
{
diff --git a/src/hei_main.hpp b/src/hei_main.hpp
index 919cd62..9c484fe 100644
--- a/src/hei_main.hpp
+++ b/src/hei_main.hpp
@@ -29,9 +29,10 @@
#pragma once
-#include <hei_includes.hpp>
+#include <hei_chip.hpp>
#include <hei_isolation_data.hpp>
-#include <isolator/hei_isolator.hpp>
+
+#include <vector>
namespace libhei
{
@@ -64,19 +65,13 @@
*
* @param i_bufferSize The size (in bytes) of the target Chip Data File.
*/
-inline void initialize(void* i_buffer, size_t i_bufferSize)
-{
- Isolator::getSingleton().initialize(i_buffer, i_bufferSize);
-}
+void initialize(void* i_buffer, size_t i_bufferSize);
/**
* @brief Deletes all internal isolation objects that were created by
* initialize().
*/
-inline void uninitialize()
-{
- Isolator::getSingleton().uninitialize();
-}
+void uninitialize();
/**
* @brief Isolates all active hardware errors found on the given list of chips.
@@ -94,10 +89,6 @@
* associated with the active errors, and any other data that
* can be useful for debug.
*/
-inline void isolate(const std::vector<Chip>& i_chipList,
- IsolationData& o_isoData)
-{
- Isolator::getSingleton().isolate(i_chipList, o_isoData);
-}
+void isolate(const std::vector<Chip>& i_chipList, IsolationData& o_isoData);
} // end namespace libhei
diff --git a/src/isolator/hei_signature.hpp b/src/hei_signature.hpp
similarity index 98%
rename from src/isolator/hei_signature.hpp
rename to src/hei_signature.hpp
index 2bf91e1..4f824db 100644
--- a/src/isolator/hei_signature.hpp
+++ b/src/hei_signature.hpp
@@ -1,6 +1,7 @@
#pragma once
-#include <hei_includes.hpp>
+#include <hei_chip.hpp>
+#include <hei_types.hpp>
namespace libhei
{
diff --git a/src/hei_user_interface.hpp b/src/hei_user_interface.hpp
index e8740f3..d880ef4 100644
--- a/src/hei_user_interface.hpp
+++ b/src/hei_user_interface.hpp
@@ -43,7 +43,9 @@
* }
*/
-#include <hei_includes.hpp>
+#include <stdlib.h>
+
+#include <hei_chip.hpp>
namespace libhei
{
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/test/simulator/simulator.hpp b/test/simulator/simulator.hpp
index 7d25160..ccb998a 100644
--- a/test/simulator/simulator.hpp
+++ b/test/simulator/simulator.hpp
@@ -2,6 +2,10 @@
#include <hei_main.hpp>
+#include <algorithm>
+#include <map>
+#include <vector>
+
#include "gtest/gtest.h"
namespace libhei