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-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 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:
51 GNEGeneralHandler(GNENet* net, const std::string& file, const bool allowUndoRedo, const bool overwrite);
52
55
57 bool postParserTasks();
58
60 bool isErrorCreatingElement() const;
61
63 bool isAdditionalFile() const;
64
66 bool isRouteFile() const;
67
69 bool isMeanDataFile() const;
70
71private:
73 struct TagType {
74
75 enum class Type {
76 NONE,
77 NETWORK,
79 DEMAND,
80 DATA,
82 };
83
86
88 bool isNetwork() const;
89
91 bool isAdditional() const;
92
94 bool isDemand() const;
95
97 bool isData() const;
98
100 bool isMeanData() const;
101
104
105 private:
108 };
109
111 std::list<TagType> myQueue;
112
115
118
121
124
126 void beginTag(SumoXMLTag tag, const SUMOSAXAttributes& attrs);
127
129 void endTag();
130
133
136};
137
138/****************************************************************************/
SumoXMLTag
Numbers representing SUMO-XML - element names.
Builds additional objects for GNENet (busStops, chargingStations, detectors, etc.....
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
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
Builds trigger objects for GNENet (busStops, chargingStations, detectors, etc..)
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