Merge pull request #201 from jfeldman/Bugfix/address_decoder_private

Make static methods for instance handling private in derived classes.
This commit is contained in:
fzeder
2018-07-03 14:02:50 +02:00
committed by GitHub Enterprise
2 changed files with 6 additions and 6 deletions

View File

@@ -46,15 +46,13 @@ using std::pair;
using std::map;
class JSONAddressDecoder
: public AddressDecoder
: private AddressDecoder
{
// Friendship needed so that the AddressDecoder can access the
// constructor of this class to create the object in CreateInstance.
friend class AddressDecoder;
private:
JSONAddressDecoder();
vector<pair<unsigned, unsigned>>
m_vXor; // This container stores for each used xor gate a pair which consists of "First/Number of an address bit which corresponds to a bank"
// and "Second/Number of an address bit which corresponds to a row"
@@ -66,6 +64,8 @@ private:
m_vColumnBits; // This container stores for each column bit a pair which consists of "First/Number of the column bit" and "Second/Number of the address bit"
public:
JSONAddressDecoder();
virtual void setConfiguration(std::string url);
virtual DecodedAddress decodeAddress(sc_dt::uint64 addr);

View File

@@ -45,21 +45,21 @@
#include "AddressDecoder.h"
class xmlAddressDecoder
: public AddressDecoder
: private AddressDecoder
{
// Friendship needed so that the AddressDecoder can access the
// constructor of this class to create the object in CreateInstance.
friend class AddressDecoder;
private:
xmlAddressDecoder();
std::map<std::string, sc_dt::uint64> masks;
std::map<std::string, unsigned int> shifts;
tinyxml2::XMLElement *addressmapping;
public:
xmlAddressDecoder();
virtual DecodedAddress decodeAddress(sc_dt::uint64 addr);
virtual sc_dt::uint64 encodeAddress(DecodedAddress n);