Created an enumeration to the possible values of storage mode.

This commit is contained in:
Éder Ferreira Zulian
2015-05-08 12:52:49 +02:00
parent fd371795c7
commit cd8aeebe6f
6 changed files with 34 additions and 21 deletions

View File

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