SUMO - Simulation of Urban MObility
ODDistrictHandler.h
Go to the documentation of this file.
00001 /****************************************************************************/
00009 // An XML-Handler for districts
00010 /****************************************************************************/
00011 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00012 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
00013 /****************************************************************************/
00014 //
00015 //   This file is part of SUMO.
00016 //   SUMO is free software: you can redistribute it and/or modify
00017 //   it under the terms of the GNU General Public License as published by
00018 //   the Free Software Foundation, either version 3 of the License, or
00019 //   (at your option) any later version.
00020 //
00021 /****************************************************************************/
00022 #ifndef ODDistrictHandler_h
00023 #define ODDistrictHandler_h
00024 
00025 
00026 // ===========================================================================
00027 // included modules
00028 // ===========================================================================
00029 #ifdef _MSC_VER
00030 #include <windows_config.h>
00031 #else
00032 #include <config.h>
00033 #endif
00034 
00035 #include <string>
00036 #include <utility>
00037 #include <utils/xml/SUMOSAXHandler.h>
00038 
00039 
00040 // ===========================================================================
00041 // class declarations
00042 // ===========================================================================
00043 class ODDistrict;
00044 class ODDistrictCont;
00045 
00046 
00047 // ===========================================================================
00048 // class definitions
00049 // ===========================================================================
00057 class ODDistrictHandler : public SUMOSAXHandler {
00058 public:
00065     ODDistrictHandler(ODDistrictCont& cont, const std::string& file) ;
00066 
00067 
00069     ~ODDistrictHandler() ;
00070 
00071 
00072 protected:
00074 
00075 
00086     void myStartElement(int element,
00087                         const SUMOSAXAttributes& attrs) ;
00088 
00089 
00097     void myEndElement(int element) ;
00099 
00100 
00101 private:
00110     void openDistrict(const SUMOSAXAttributes& attrs) ;
00111 
00112 
00124     void addSource(const SUMOSAXAttributes& attrs) ;
00125 
00126 
00138     void addSink(const SUMOSAXAttributes& attrs) ;
00139 
00140 
00145     void closeDistrict() ;
00146 
00147 
00163     std::pair<std::string, SUMOReal> parseConnection(const SUMOSAXAttributes& attrs) ;
00164 
00165 private:
00167     ODDistrictCont& myContainer;
00168 
00170     ODDistrict* myCurrentDistrict;
00171 
00172     bool myHaveWarnedAboutDeprecatedDistrict, myHaveWarnedAboutDeprecatedDSource, myHaveWarnedAboutDeprecatedDSink;
00173 
00174 
00175 private:
00177     ODDistrictHandler(const ODDistrictHandler& s);
00178 
00180     ODDistrictHandler& operator=(const ODDistrictHandler& s);
00181 
00182 
00183 };
00184 
00185 
00186 #endif
00187 
00188 /****************************************************************************/
00189 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines