SUMOVehicleParserHelper.h

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // Helper methods for parsing vehicle attributes
00008 /****************************************************************************/
00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00010 // Copyright 2001-2010 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 SUMOVehicleParserHelper_h
00020 #define SUMOVehicleParserHelper_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 <utils/xml/SUMOSAXHandler.h>
00034 #include <utils/xml/SUMOXMLDefinitions.h>
00035 #include <utils/common/SUMOTime.h>
00036 #include <utils/common/SUMOVehicleClass.h>
00037 #include <utils/common/SUMOVehicleParameter.h>
00038 #include <utils/common/SUMOVTypeParameter.h>
00039 #include <utils/common/UtilExceptions.h>
00040 
00041 
00042 // ===========================================================================
00043 // class definitions
00044 // ===========================================================================
00051 class SUMOVehicleParserHelper {
00052 public:
00062     static SUMOVehicleParameter *parseFlowAttributes(const SUMOSAXAttributes &attrs) throw(ProcessError);
00063 
00064 
00076     static SUMOVehicleParameter *parseVehicleAttributes(const SUMOSAXAttributes &attrs,
00077             bool skipID=false, bool skipDepart=false) throw(ProcessError);
00078 
00079 
00086     static SUMOVTypeParameter *beginVTypeParsing(const SUMOSAXAttributes &attrs) throw(ProcessError);
00087 
00088 
00098     static void parseVTypeEmbedded(SUMOVTypeParameter &into,
00099                                    int element, const SUMOSAXAttributes &attrs,
00100                                    bool fromVType=false) throw(ProcessError);
00101 
00102 
00111     static void parseVTypeEmbedded_Krauss(SUMOVTypeParameter &into,
00112                                           const SUMOSAXAttributes &attrs,
00113                                           bool fromVType=false) throw(ProcessError);
00114 
00115 
00123     static void parseVTypeEmbedded_IDM(SUMOVTypeParameter &into,
00124                                        const SUMOSAXAttributes &attrs) throw(ProcessError);
00125 
00126 
00134     static void parseVTypeEmbedded_BKerner(SUMOVTypeParameter &into,
00135                                            const SUMOSAXAttributes &attrs) throw(ProcessError);
00136 
00137 
00142     static void closeVTypeParsing(SUMOVTypeParameter &vtype) throw() { }
00143 
00144 
00160     static SUMOVehicleClass parseVehicleClass(const SUMOSAXAttributes &attrs, const std::string &type,
00161             const std::string &id) throw();
00162 
00163 
00179     static SUMOEmissionClass parseEmissionClass(const SUMOSAXAttributes &attrs, const std::string &type,
00180             const std::string &id) throw();
00181 
00182 
00198     static SUMOVehicleShape parseGuiShape(const SUMOSAXAttributes &attrs, const std::string &type,
00199                                           const std::string &id) throw();
00200 
00201 
00202 private:
00213     static void parseCommonAttributes(const SUMOSAXAttributes &attrs,
00214                                       SUMOVehicleParameter *ret, std::string element) throw(ProcessError);
00215 
00216 
00217 };
00218 
00219 
00220 #endif
00221 
00222 /****************************************************************************/
00223 

Generated on Wed May 5 00:06:36 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6