SUMO - Simulation of Urban MObility

NBDistrictCont.h

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // A container for districts
00008 /****************************************************************************/
00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00010 // Copyright (C) 2001-2011 DLR (http://www.dlr.de/) and contributors
00011 /****************************************************************************/
00012 //
00013 //   This program is free software; you can redistribute it and/or modify
00014 //   it under the terms of the GNU General Public License as published by
00015 //   the Free Software Foundation; either version 2 of the License, or
00016 //   (at your option) any later version.
00017 //
00018 /****************************************************************************/
00019 #ifndef NBDistrictCont_h
00020 #define NBDistrictCont_h
00021 
00022 
00023 // ===========================================================================
00024 // included modules
00025 // ===========================================================================
00026 #ifdef _MSC_VER
00027 #include <windows_config.h>
00028 #else
00029 #include <config.h>
00030 #endif
00031 
00032 #include <map>
00033 #include <string>
00034 
00035 
00036 // ===========================================================================
00037 // class declarations
00038 // ===========================================================================
00039 class NBDistrict;
00040 class NBEdge;
00041 class NBNodeCont;
00042 class OutputDevice;
00043 
00044 
00045 // ===========================================================================
00046 // class definitions
00047 // ===========================================================================
00058 class NBDistrictCont {
00059 public:
00061     NBDistrictCont() throw();
00062 
00063 
00065     ~NBDistrictCont() throw();
00066 
00067 
00073     bool insert(NBDistrict* const district) throw();
00074 
00075 
00081     NBDistrict* retrieve(const std::string& id) const throw();
00082 
00083 
00087     std::map<std::string, NBDistrict*>::const_iterator begin() const {
00088         return myDistricts.begin();
00089     }
00090 
00091 
00095     std::map<std::string, NBDistrict*>::const_iterator end() const {
00096         return myDistricts.end();
00097     }
00098 
00099 
00101     size_t size() const throw();
00102 
00103 
00116     bool addSource(const std::string& dist, NBEdge* const source,
00117                    SUMOReal weight) throw();
00118 
00119 
00132     bool addSink(const std::string& dist, NBEdge* const destination,
00133                  SUMOReal weight) throw();
00134 
00135 
00144     void removeFromSinksAndSources(NBEdge* const e) throw();
00145 
00146 
00147 private:
00149     typedef std::map<std::string, NBDistrict*> DistrictCont;
00150 
00152     DistrictCont myDistricts;
00153 
00154 
00155 private:
00157     NBDistrictCont(const NBDistrictCont& s);
00158 
00160     NBDistrictCont& operator=(const NBDistrictCont& s);
00161 
00162 
00163 };
00164 
00165 
00166 #endif
00167 
00168 /****************************************************************************/
00169 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines