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 isErrorCreatingElement() const;
58
60 bool isAdditionalFile() const;
61
63 bool isRouteFile() const;
64
66 bool isMeanDataFile() const;
67
68private:
70 struct TagType {
71
72 enum class Type {
73 NONE,
74 NETWORK,
76 DEMAND,
77 DATA,
79 };
80
83
85 bool isNetwork() const;
86
88 bool isAdditional() const;
89
91 bool isDemand() const;
92
94 bool isData() const;
95
97 bool isMeanData() const;
98
101
102 private:
105 };
106
108 std::list<TagType> myQueue;
109
112
115
118
121
123 void beginTag(SumoXMLTag tag, const SUMOSAXAttributes& attrs);
124
126 void endTag();
127
130
133};
134
135/****************************************************************************/
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
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