00001 /****************************************************************************/ 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 TRACIHANDLER_H 00020 #define TRACIHANDLER_H 00021 00022 // =========================================================================== 00023 // included modules 00024 // =========================================================================== 00025 #ifdef _MSC_VER 00026 #include <windows_config.h> 00027 #else 00028 #include <config.h> 00029 #endif 00030 00031 #ifndef NO_TRACI 00032 00033 #include "utils/xml/SUMOSAXHandler.h" 00034 00035 // =========================================================================== 00036 // class declarations 00037 // =========================================================================== 00038 00039 00040 // =========================================================================== 00041 // class definitions 00042 // =========================================================================== 00049 namespace traci { 00050 class TraCIHandler : public SUMOSAXHandler { 00051 public: 00056 TraCIHandler(const std::string& file = "") throw(); 00057 00061 virtual ~TraCIHandler() throw(); 00062 00067 int getTotalVehicleCount(); 00068 00072 void resetTotalVehicleCount(); 00073 00074 protected: 00076 00077 00085 virtual void myStartElement(SumoXMLTag element, 00086 const SUMOSAXAttributes& attributes) throw(ProcessError); 00087 00094 virtual void myEndElement(SumoXMLTag element) throw(ProcessError); 00095 00097 00098 private: 00099 int totalVehicleCount; 00100 00101 int currentVehCount; 00102 00103 private: 00107 void openVehicleTag(const SUMOSAXAttributes& attributes); 00108 }; 00109 } 00110 00111 #endif 00112 00113 #endif
1.5.6