SUMO - Simulation of Urban MObility

ODDistrictHandler.h

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // An XML-Handler 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 ODDistrictHandler_h
00020 #define ODDistrictHandler_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 <string>
00033 #include <utility>
00034 #include <utils/xml/SUMOSAXHandler.h>
00035 
00036 
00037 // ===========================================================================
00038 // class declarations
00039 // ===========================================================================
00040 class ODDistrict;
00041 class ODDistrictCont;
00042 
00043 
00044 // ===========================================================================
00045 // class definitions
00046 // ===========================================================================
00054 class ODDistrictHandler : public SUMOSAXHandler {
00055 public:
00062     ODDistrictHandler(ODDistrictCont& cont, const std::string& file) throw();
00063 
00064 
00066     ~ODDistrictHandler() throw();
00067 
00068 
00069 protected:
00071 
00072 
00083     void myStartElement(int element,
00084                         const SUMOSAXAttributes& attrs) throw(ProcessError);
00085 
00086 
00094     void myEndElement(int element) throw(ProcessError);
00096 
00097 
00098 private:
00107     void openDistrict(const SUMOSAXAttributes& attrs) throw();
00108 
00109 
00121     void addSource(const SUMOSAXAttributes& attrs) throw();
00122 
00123 
00135     void addSink(const SUMOSAXAttributes& attrs) throw();
00136 
00137 
00142     void closeDistrict() throw();
00143 
00144 
00160     std::pair<std::string, SUMOReal> parseConnection(const SUMOSAXAttributes& attrs) throw();
00161 
00162 private:
00164     ODDistrictCont& myContainer;
00165 
00167     ODDistrict* myCurrentDistrict;
00168 
00169     bool myHaveWarnedAboutDeprecatedDistrict, myHaveWarnedAboutDeprecatedDSource, myHaveWarnedAboutDeprecatedDSink;
00170 
00171 
00172 private:
00174     ODDistrictHandler(const ODDistrictHandler& s);
00175 
00177     ODDistrictHandler& operator=(const ODDistrictHandler& s);
00178 
00179 
00180 };
00181 
00182 
00183 #endif
00184 
00185 /****************************************************************************/
00186 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines