Created an enumeration to the possible values of storage mode.
This commit is contained in:
@@ -57,6 +57,20 @@ EPowerDownMode string2PDNMode(string s)
|
||||
}
|
||||
}
|
||||
|
||||
StorageMode string2StorageMode(string s)
|
||||
{
|
||||
if (s == "NoStorage")
|
||||
return StorageMode::NoStorage;
|
||||
else if (s == "Store")
|
||||
return StorageMode::Store;
|
||||
else if (s == "ErrorModel")
|
||||
return StorageMode::ErrorModel;
|
||||
else
|
||||
{
|
||||
SC_REPORT_FATAL("Configuration", ("Unknown StorageMode: " + s).c_str());
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
void Configuration::setParameter(std::string name, std::string value)
|
||||
{
|
||||
@@ -99,7 +113,7 @@ void Configuration::setParameter(std::string name, std::string value)
|
||||
else if(name == "csvfile")
|
||||
csvfile = value;
|
||||
else if(name == "StorMo")
|
||||
StorMode = string2int(value);
|
||||
StorMode = string2StorageMode(value);
|
||||
else
|
||||
{
|
||||
SC_REPORT_FATAL("Configuration", ("Parameter " + name + " not defined in Configuration").c_str());
|
||||
|
||||
Reference in New Issue
Block a user