Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEGeneralHandler.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-2025 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 for netedit
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
23
24// ===========================================================================
25// included modules
26// ===========================================================================
27
32
33// ===========================================================================
34// class declarations
35// ===========================================================================
36class GNENet;
37
38// ===========================================================================
39// class definitions
40// ===========================================================================
41
43
44public:
50 GNEGeneralHandler(GNENet* net, FileBucket* bucket, const bool allowUndoRedo);
51
54
57
59 bool isErrorCreatingElement() const;
60
62 bool isAdditionalFile() const;
63
65 bool isRouteFile() const;
66
68 bool isMeanDataFile() const;
69
70private:
72 struct TagType {
73
74 enum class Type {
75 NONE,
76 NETWORK,
78 DEMAND,
79 DATA,
81 };
82
85
87 bool isNetwork() const;
88
90 bool isAdditional() const;
91
93 bool isDemand() const;
94
96 bool isData() const;
97
99 bool isMeanData() const;
100
103
104 private:
107 };
108
110 std::list<TagType> myQueue;
111
114
117
120
123
125 void beginTag(SumoXMLTag tag, const SUMOSAXAttributes& attrs);
126
128 void endTag();
129
132
135};
136
137/****************************************************************************/
SumoXMLTag
Numbers representing SUMO-XML - element names.
void endTag()
end element
bool isAdditionalFile() const
check if the parser file is a additional file
void beginTag(SumoXMLTag tag, const SUMOSAXAttributes &attrs)
start element
bool isRouteFile() const
check if the parser file is a route file
~GNEGeneralHandler()
Destructor.
std::list< TagType > myQueue
queue with the inserted tags
bool isMeanDataFile() const
check if the parser file is a meanData file
GNEGeneralHandler(const GNEGeneralHandler &s)=delete
invalidate copy constructor
void forceOverwriteElements()
force overwritte elements (used if we're reloading elements)
GNEAdditionalHandler myAdditionalHandler
additional handler
bool isErrorCreatingElement() const
get flag for check if a element wasn't created
TagType::Type fileType
flag for set file type
GNEGeneralHandler & operator=(const GNEGeneralHandler &s)=delete
invalidate assignment operator
GNEMeanDataHandler myMeanDataHandler
meanData handler
GNERouteHandler myDemandHandler
demand handler
Encapsulated SAX-Attributes.
const SumoXMLTag tag
tag related with this TagType
bool isDemand() const
is network element
bool isData() const
is network element
bool isMeanData() const
is network element
bool isNetwork() const
is network element
bool isAdditional() const
is network element