Quick and Dirty XML - Refactoring necessary

This commit is contained in:
Janik Schlemminger
2014-09-04 23:35:54 +02:00
parent 610dc6e6a5
commit 2aa07bbbe6
13 changed files with 201 additions and 87 deletions

View File

@@ -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;