added a pure virtual destructor to abstract Register class
Change-Id: I885b36372877b64ce02fcc679f1fd477d06c54ba
Signed-off-by: Zane Shelley <zshelle@us.ibm.com>
diff --git a/src/isolator/hei_isolator.cpp b/src/isolator/hei_isolator.cpp
index b09f16a..0b3f88f 100644
--- a/src/isolator/hei_isolator.cpp
+++ b/src/isolator/hei_isolator.cpp
@@ -14,6 +14,8 @@
// BEGIN temporary code
HEI_INF( "Isolator::initialize(%p,%lu,%d)", i_buffer, i_bufferSize,
i_forceInit );
+
+ Flyweight<HardwareRegister>::getSingleton().get( HardwareRegister {} );
// END temporary code
return rc;
diff --git a/src/register/hei_hardware_register.cpp b/src/register/hei_hardware_register.cpp
index 58106bf..e007eca 100755
--- a/src/register/hei_hardware_register.cpp
+++ b/src/register/hei_hardware_register.cpp
@@ -183,11 +183,11 @@
#endif // __HEI_READ_ONLY
-#if 0
//------------------------------------------------------------------------------
bool HardwareRegister::operator == ( const HardwareRegister & i_rightRegister ) const
{
+#if 0
if( iv_scomAddress == i_rightRegister.GetAddress() )
{
return ( iv_chipType == i_rightRegister.getChipType() );
@@ -196,12 +196,14 @@
{
return false ;
}
-
+#endif
+ return false;
}
//-----------------------------------------------------------------------------
bool HardwareRegister::operator < ( const HardwareRegister & i_rightRegister ) const
{
+#if 0
if( iv_scomAddress == i_rightRegister.GetAddress() )
{
return ( iv_chipType < i_rightRegister.getChipType() );
@@ -210,9 +212,10 @@
{
return( iv_scomAddress < i_rightRegister.GetAddress() );
}
-
-
+#endif
+ return false;
}
+#if 0
//-----------------------------------------------------------------------------
bool HardwareRegister::operator >= ( const HardwareRegister & i_rightRegister ) const
{
diff --git a/src/register/hei_hardware_register.hpp b/src/register/hei_hardware_register.hpp
index 7588a6c..255cf5a 100755
--- a/src/register/hei_hardware_register.hpp
+++ b/src/register/hei_hardware_register.hpp
@@ -79,15 +79,12 @@
iv_scomAddress( 0 ),
iv_operationType( ACCESS_NONE )
{}
+#endif
- /**
- * @brief Returns the pointer to bit string
- * @param i_type attention type
- * @return BitString * pointer to bit string
- */
+ /** Function overloaded from parent Register class. */
+ virtual const BitString * getBitString() const { return nullptr; }
- virtual const BitString * GetBitString(ATTENTION_TYPE i_type =
- INVALID_ATTENTION_TYPE) const;
+#if 0
/**
* @brief Updates bit string contents associated with register
* @param i_bs poiner to bit string
@@ -153,6 +150,7 @@
* @return Refer to function description
*/
uint64_t GetAddress( ) const {return iv_scomAddress ;};
+#endif
/**
* @brief compares two ScomRegisterAccess register for equality
* @param i_rightRegister register to be compared against
@@ -165,6 +163,7 @@
* @return Returns false if i_rightRegisters is less and true otherwise
*/
bool operator < ( const HardwareRegister & i_rightRegister ) const ;
+#if 0
/**
* @brief defines >= operation for ScomRegisterAccess
* @param i_rightRegister register to be compared against
diff --git a/src/register/hei_register.hpp b/src/register/hei_register.hpp
index c352d92..3e2fb8d 100755
--- a/src/register/hei_register.hpp
+++ b/src/register/hei_register.hpp
@@ -1,6 +1,5 @@
#pragma once
-#include <stdio.h>
#include <hei_includes.hpp>
#include <util/hei_bit_string.hpp>
@@ -8,7 +7,7 @@
{
/**
-@brief Description: The Register class.
+@brief An abstract class for register objects.
Purpose: Register is an abstract base class for real and virtual registers.
A few examples of these registers are; HardwareRegister, ConstantRegister,
@@ -30,22 +29,8 @@
{
public:
- /**
- @brief Default constructor
- */
- Register() = default;
-
- /**
- @brief Delete copy, assignment, and move operators. Deleting
- copy causes the compiler to delete move.
- */
- Register(const Register&) = delete;
- Register& operator=(const Register&) = delete;
-
- /**
- @brief Default destructor
- */
- virtual ~Register() = default;
+ /** @brief Pure virtual destructor. */
+ virtual ~Register() = 0;
/**
@brief Provides access to the BitString that manages
@@ -56,4 +41,7 @@
};
+// Pure virtual destructor must be defined.
+inline Register::~Register() {}
+
}//end namespace libhei