 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
58 for (
auto i : mapArg) {
59 myMap[i.first] = i.second;
72 std::map<std::string, std::string>::const_iterator i =
myMap.find(key);
73 if (i !=
myMap.end()) {
82 std::map<std::string, std::string>::const_iterator i =
myMap.find(key);
83 if (i !=
myMap.end()) {
87 WRITE_WARNING(
"Invalid conversion from string to double (" + i->second +
")");
90 WRITE_WARNING(
"Invalid conversion from string to double (empty value)");
104 const std::map<std::string, std::string>&
113 for (
auto i :
myMap) {
void updateParameter(const std::map< std::string, std::string > &mapArg)
Adds or updates all given parameters from the map.
#define WRITE_WARNING(msg)
Static storage of an output device and its base (abstract) implementation.
parameter associated to a certain key
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
Parameterised()
Constructor.
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.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
static std::string escapeXML(const std::string &orig, const bool maskDoubleHyphen=false)
Replaces the standard escapes by their XML entities.
~Parameterised()
Destructor.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
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.