Eclipse SUMO - Simulation of Urban MObility
ConfigHandler.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2022 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
18 // The XML-Handler for SUMOConfig loading
19 /****************************************************************************/
20 #pragma once
21 #include <config.h>
22 
25 
26 // ===========================================================================
27 // class definitions
28 // ===========================================================================
29 
31 class ConfigHandler : private SUMOSAXHandler {
32 
33 public:
35  ConfigHandler(const std::string& file);
36 
38  virtual ~ConfigHandler();
39 
41  bool parse();
42 
47  virtual void loadConfig(CommonXMLStructure::SumoBaseObject* configObj) = 0;
48 
49 private:
52 
55 
63  virtual void myStartElement(int element, const SUMOSAXAttributes& attrs);
64 
72  virtual void myEndElement(int element);
74 
77 
79  void parseConfigFile();
80 
82  void parseNetFile(const SUMOSAXAttributes& attrs);
83 
85  void parseAdditionalFiles(const SUMOSAXAttributes& attrs);
86 
88  void parseRouteFiles(const SUMOSAXAttributes& attrs);
89 
91  void parseDataFiles(const SUMOSAXAttributes& attrs);
92 
94 
96  ConfigHandler(const ConfigHandler& s) = delete;
97 
99  ConfigHandler& operator=(const ConfigHandler& s) = delete;
100 };
handler for SUMOConfigs
Definition: ConfigHandler.h:31
virtual void loadConfig(CommonXMLStructure::SumoBaseObject *configObj)=0
Load net file.
bool parse()
parse
virtual void myEndElement(int element)
Called when a closing tag occurs.
ConfigHandler & operator=(const ConfigHandler &s)=delete
invalidate assignment operator
virtual ~ConfigHandler()
Destructor.
void parseRouteFiles(const SUMOSAXAttributes &attrs)
parse route files attribute
CommonXMLStructure myCommonXMLStructure
common XML Structure
Definition: ConfigHandler.h:51
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
void parseDataFiles(const SUMOSAXAttributes &attrs)
parse data files attribute
ConfigHandler(const ConfigHandler &s)=delete
invalidate copy constructor
ConfigHandler(const std::string &file)
Constructor.
void parseConfigFile()
parse config file attribute
void parseAdditionalFiles(const SUMOSAXAttributes &attrs)
parse additional files attribute
void parseNetFile(const SUMOSAXAttributes &attrs)
parse net file attribute
Encapsulated SAX-Attributes.
SAX-handler base for SUMO-files.