 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
19 #ifndef Parameterised_h
20 #define Parameterised_h
50 Parameterised(
const std::map<std::string, std::string>& mapArg);
59 void setParameter(
const std::string& key,
const std::string& value);
82 const std::string
getParameter(
const std::string& key,
const std::string& defaultValue =
"")
const;
89 double getDouble(
const std::string& key,
const double defaultValue)
const;
120 std::map<std::string, std::string>
myMap;
static bool isParameterValid(const std::string &value, bool report)
check if given string can be parsed to a parameter of type "key=value"
std::string getParametersStr() const
Returns the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN".
An upper class for objects with additional parameters.
Static storage of an output device and its base (abstract) implementation.
Parameterised()
Constructor.
void setParameters(const Parameterised ¶ms)
set the inner key/value map in map<string, string> format
void setParametersMap(const std::map< std::string, std::string > ¶msMap)
set the inner key/value map in map<string, string> format
void writeParams(OutputDevice &device) const
write Params in the given outputdevice
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
void updateParameters(const std::map< std::string, std::string > &mapArg)
Adds or updates all given parameters from the map.
~Parameterised()
Destructor.
void setParametersStr(const std::string ¶msString)
set the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN"
static bool areParametersValid(const std::string &value, bool report=false)
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
void unsetParameter(const std::string &key)
Removes a parameter.
void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
void clearParameter()
Clears the parameter map.
std::map< std::string, std::string > myMap
The key->value map.
double getDouble(const std::string &key, const double defaultValue) const
Returns the value for a given key converted to a double.
bool knowsParameter(const std::string &key) const
Returns whether the parameter is known.