SUMO - Simulation of Urban MObility
NLDiscreteEventBuilder.h
Go to the documentation of this file.
00001 /****************************************************************************/
00008 // missing_desc
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 NLDiscreteEventBuilder_h
00022 #define NLDiscreteEventBuilder_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 <xercesc/sax2/Attributes.hpp>
00035 #include <string>
00036 #include <map>
00037 #include <utils/xml/GenericSAXHandler.h>
00038 
00039 
00040 // ===========================================================================
00041 // class declarations
00042 // ===========================================================================
00043 class MSNet;
00044 
00045 
00046 // ===========================================================================
00047 // class definitions
00048 // ===========================================================================
00054 class NLDiscreteEventBuilder {
00055 public:
00057     enum ActionType {
00059         EV_SAVETLSTATE,
00061         EV_SAVETLSWITCHES,
00063         EV_SAVETLSWITCHSTATES
00064     };
00065 
00067     NLDiscreteEventBuilder(MSNet& net);
00068 
00070     ~NLDiscreteEventBuilder();
00071 
00073     void addAction(const SUMOSAXAttributes& attrs, const std::string& basePath);
00074 
00075 private:
00077     void buildSaveTLStateCommand(const SUMOSAXAttributes& attrs, const std::string& basePath);
00078 
00080     void buildSaveTLSwitchesCommand(const SUMOSAXAttributes& attrs, const std::string& basePath);
00081 
00083     void buildSaveTLSwitchStatesCommand(const SUMOSAXAttributes& attrs, const std::string& basePath);
00084 
00085 private:
00086     NLDiscreteEventBuilder& operator=(const NLDiscreteEventBuilder&); // just to avoid a compiler warning
00087 
00088 protected:
00090     typedef std::map<std::string, ActionType> KnownActions;
00091 
00093     KnownActions myActions;
00094 
00095     MSNet& myNet;
00096 
00097 };
00098 
00099 
00100 #endif
00101 
00102 /****************************************************************************/
00103 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines