Eclipse SUMO - Simulation of Urban MObility
GeneralHandler.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 // Copyright (C) 2001-2024 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 // General element handler
19 /****************************************************************************/
20 #pragma once
21 #include <config.h>
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
28 
29 
30 // ===========================================================================
31 // class definitions
32 // ===========================================================================
33 
35 
36 public:
40  GeneralHandler(const std::string& file);
41 
44 
46  bool parse();
47 
48 private:
50  virtual void beginTag(SumoXMLTag tag, const SUMOSAXAttributes& attrs) = 0;
51 
53  virtual void endTag() = 0;
54 
57 
65  void myStartElement(int element, const SUMOSAXAttributes& attrs);
66 
74  void myEndElement(int element);
76 
78  GeneralHandler(const GeneralHandler& s) = delete;
79 
82 };
83 
84 /****************************************************************************/
SumoXMLTag
Numbers representing SUMO-XML - element names.
virtual void endTag()=0
end element
GeneralHandler & operator=(const GeneralHandler &s)=delete
invalidate assignment operator
bool parse()
parse
GeneralHandler(const std::string &file)
Constructor.
virtual void beginTag(SumoXMLTag tag, const SUMOSAXAttributes &attrs)=0
start element
GeneralHandler(const GeneralHandler &s)=delete
invalidate copy constructor
~GeneralHandler()
Destructor.
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
void myEndElement(int element)
Called when a closing tag occurs.
Encapsulated SAX-Attributes.
SAX-handler base for SUMO-files.