Quick and Dirty XML - Refactoring necessary
This commit is contained in:
@@ -38,18 +38,32 @@ class xmlAddressDecoder
|
||||
{
|
||||
|
||||
public:
|
||||
static std::string addressConfigURI;
|
||||
|
||||
//static std::string addressConfigURI;
|
||||
//static tinyxml2::XMLElement* addressmapping;
|
||||
static tinyxml2::XMLElement* addressmapping;
|
||||
static inline xmlAddressDecoder& getInstance()
|
||||
{
|
||||
static xmlAddressDecoder decoder(xmlAddressDecoder::addressConfigURI);
|
||||
//if(decoder==NULL) std::cout<<"ERROR: AddressDecoder has been called before initialization"<<std::endl;
|
||||
static xmlAddressDecoder decoder(xmlAddressDecoder::addressmapping);
|
||||
return decoder;
|
||||
}
|
||||
|
||||
DecodedAddress decodeAddress(sc_dt::uint64 addr);
|
||||
static inline void Initialize(tinyxml2::XMLElement* mapping)
|
||||
{
|
||||
addressmapping = mapping;
|
||||
//decoder = xmlAddressDecoder(addressmapping);
|
||||
xmlAddressDecoder::getInstance();
|
||||
addressmapping = NULL;
|
||||
}
|
||||
|
||||
DecodedAddress decodeAddress(sc_dt::uint64 addr);
|
||||
private:
|
||||
|
||||
//static xmlAddressDecoder decoder;
|
||||
|
||||
//xmlAddressDecoder();
|
||||
xmlAddressDecoder(std::string URI);
|
||||
xmlAddressDecoder(tinyxml2::XMLElement* addressMap);
|
||||
|
||||
std::map<std::string, sc_dt::uint64> masks;
|
||||
std::map<std::string, unsigned int> shifts;
|
||||
|
||||
Reference in New Issue
Block a user