SUMO - Simulation of Urban MObility
NBDistrictCont.h
Go to the documentation of this file.
00001 /****************************************************************************/
00008 // A container for districts
00009 /****************************************************************************/
00010 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00011 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
00012 /****************************************************************************/
00013 //
00014 //   This file is part of SUMO.
00015 //   SUMO is free software: you can redistribute it and/or modify
00016 //   it under the terms of the GNU General Public License as published by
00017 //   the Free Software Foundation, either version 3 of the License, or
00018 //   (at your option) any later version.
00019 //
00020 /****************************************************************************/
00021 #ifndef NBDistrictCont_h
00022 #define NBDistrictCont_h
00023 
00024 
00025 // ===========================================================================
00026 // included modules
00027 // ===========================================================================
00028 #ifdef _MSC_VER
00029 #include <windows_config.h>
00030 #else
00031 #include <config.h>
00032 #endif
00033 
00034 #include <map>
00035 #include <string>
00036 
00037 
00038 // ===========================================================================
00039 // class declarations
00040 // ===========================================================================
00041 class NBDistrict;
00042 class NBEdge;
00043 class NBNodeCont;
00044 class OutputDevice;
00045 
00046 
00047 // ===========================================================================
00048 // class definitions
00049 // ===========================================================================
00060 class NBDistrictCont {
00061 public:
00063     NBDistrictCont() ;
00064 
00065 
00067     ~NBDistrictCont() ;
00068 
00069 
00075     bool insert(NBDistrict* const district) ;
00076 
00077 
00083     NBDistrict* retrieve(const std::string& id) const ;
00084 
00085 
00089     std::map<std::string, NBDistrict*>::const_iterator begin() const {
00090         return myDistricts.begin();
00091     }
00092 
00093 
00097     std::map<std::string, NBDistrict*>::const_iterator end() const {
00098         return myDistricts.end();
00099     }
00100 
00101 
00103     size_t size() const ;
00104 
00105 
00118     bool addSource(const std::string& dist, NBEdge* const source,
00119                    SUMOReal weight) ;
00120 
00121 
00134     bool addSink(const std::string& dist, NBEdge* const destination,
00135                  SUMOReal weight) ;
00136 
00137 
00146     void removeFromSinksAndSources(NBEdge* const e) ;
00147 
00148 
00149 private:
00151     typedef std::map<std::string, NBDistrict*> DistrictCont;
00152 
00154     DistrictCont myDistricts;
00155 
00156 
00157 private:
00159     NBDistrictCont(const NBDistrictCont& s);
00160 
00162     NBDistrictCont& operator=(const NBDistrictCont& s);
00163 
00164 
00165 };
00166 
00167 
00168 #endif
00169 
00170 /****************************************************************************/
00171 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines