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, const std::string& file, const bool allowUndoRedo);
51
54
57
59 bool postParserTasks();
60
62 bool isErrorCreatingElement() const;
63
65 bool isAdditionalFile() const;
66
68 bool isRouteFile() const;
69
71 bool isMeanDataFile() const;
72
73private:
75 struct TagType {
76
77 enum class Type {
78 NONE,
79 NETWORK,
81 DEMAND,
82 DATA,
84 };
85
88
90 bool isNetwork() const;
91
93 bool isAdditional() const;
94
96 bool isDemand() const;
97
99 bool isData() const;
100
102 bool isMeanData() const;
103
106
107 private:
110 };
111
113 std::list<TagType> myQueue;
114
117
120
123
126
128 void beginTag(SumoXMLTag tag, const SUMOSAXAttributes& attrs);
129
131 void endTag();
132
135
138};
139
140/****************************************************************************/
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)
bool postParserTasks()
run post parser tasks
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
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
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