SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Parameterised.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // An upper class for objects with additional parameters
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
12 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef Parameterised_h
23 #define Parameterised_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <map>
36 #include <string>
37 
38 
39 // ===========================================================================
40 // class definitions
41 // ===========================================================================
47 public:
50  Parameterised();
51 
52 
56  Parameterised(const std::map<std::string, std::string>& mapArg);
57 
58 
61 
62 
63 
68  void addParameter(const std::string& key, const std::string& value);
69 
70 
74  void addParameter(const std::map<std::string, std::string>& mapArg);
75 
76 
80  void addParameter(const Parameterised& p);
81 
82 
87  bool knowsParameter(const std::string& key) const;
88 
89 
95  const std::string& getParameter(const std::string& key, const std::string& defaultValue) const;
96 
97 
100  void clearParameter();
101 
102 
106  const std::map<std::string, std::string>& getMap() const {
107  return myMap;
108  }
109 
110 
111 private:
113  std::map<std::string, std::string> myMap;
114 
115 };
116 
117 
118 #endif
119 
120 /****************************************************************************/
121