SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NBDistrictCont.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // A container for districts
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
11 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef NBDistrictCont_h
22 #define NBDistrictCont_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <map>
35 #include <string>
36 
37 
38 // ===========================================================================
39 // class declarations
40 // ===========================================================================
41 class NBDistrict;
42 class NBEdge;
43 class NBNodeCont;
44 class OutputDevice;
45 
46 
47 // ===========================================================================
48 // class definitions
49 // ===========================================================================
61 public:
64 
65 
68 
69 
75  bool insert(NBDistrict* const district);
76 
77 
83  NBDistrict* retrieve(const std::string& id) const;
84 
85 
89  std::map<std::string, NBDistrict*>::const_iterator begin() const {
90  return myDistricts.begin();
91  }
92 
93 
97  std::map<std::string, NBDistrict*>::const_iterator end() const {
98  return myDistricts.end();
99  }
100 
101 
103  size_t size() const;
104 
105 
118  bool addSource(const std::string& dist, NBEdge* const source,
119  SUMOReal weight);
120 
121 
134  bool addSink(const std::string& dist, NBEdge* const destination,
135  SUMOReal weight);
136 
137 
146  void removeFromSinksAndSources(NBEdge* const e);
147 
148 
149 private:
151  typedef std::map<std::string, NBDistrict*> DistrictCont;
152 
155 
156 
157 private:
159  NBDistrictCont(const NBDistrictCont& s);
160 
163 
164 
165 };
166 
167 
168 #endif
169 
170 /****************************************************************************/
171