clearly separate master/slave symbolstrings

This commit is contained in:
john30
2017-02-26 17:34:22 +01:00
parent 1a878694d2
commit cc59b32f0d
13 changed files with 297 additions and 218 deletions
+26 -1
View File
@@ -113,13 +113,14 @@ int parseSignedInt(const char* str, int base, const int minValue, const int maxV
* A string of unescaped bus symbols.
*/
class SymbolString {
public:
protected:
/**
* Creates a new empty instance.
* @param isMaster whether this instance if for the master part.
*/
explicit SymbolString(const bool isMaster = false) { m_isMaster = isMaster; }
public:
/**
* Update the CRC by adding a value.
* @param crc the current CRC to update.
@@ -268,6 +269,30 @@ class SymbolString {
};
/**
* A string of unescaped master bus symbols.
*/
class MasterSymbolString : public SymbolString {
public:
/**
* Creates a new empty instance.
*/
MasterSymbolString() : SymbolString(true) {}
};
/**
* A string of unescaped slave bus symbols.
*/
class SlaveSymbolString : public SymbolString {
public:
/**
* Creates a new empty instance.
*/
SlaveSymbolString() : SymbolString(false) {}
};
/**
* Return whether the address is one of the 25 master addresses.
* @param addr the address to check.