Eclipse SUMO - Simulation of Urban MObility
GNEDataHandler.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2022 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 // Builds data objects for netedit
19 /****************************************************************************/
20 #pragma once
21 #include <config.h>
22 
24 
25 
26 // ===========================================================================
27 // class declarations
28 // ===========================================================================
29 class GNENet;
30 
31 // ===========================================================================
32 // class definitions
33 // ===========================================================================
34 
36 class GNEDataHandler : public DataHandler {
37 
38 public:
40  GNEDataHandler(GNENet* net, const std::string& file, const bool allowUndoRedo);
41 
44 
47 
50  void buildDataSet(const std::string& dataSetID);
51 
58  void buildDataInterval(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& dataSetID,
59  const double begin, const double end);
60 
66  void buildEdgeData(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& edgeID,
67  const std::map<std::string, std::string>& parameters);
68 
75  void buildEdgeRelationData(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& fromEdgeID,
76  const std::string& toEdgeID, const std::map<std::string, std::string>& parameters);
77 
84  void buildTAZRelationData(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& fromTAZID,
85  const std::string& toTAZID, const std::map<std::string, std::string>& parameters);
87 
88 protected:
91 
93  const bool myAllowUndoRedo;
94 
96  void writeErrorDuplicated(const SumoXMLTag tag, const std::string& id) const;
97 
99  void writeErrorInvalidParent(const SumoXMLTag tag, const SumoXMLTag parent) const;
100 
102  void writeErrorInvalidParent(const SumoXMLTag tag, const SumoXMLTag parent, const std::string& ID) const;
103 
104 private:
106  GNEDataHandler(const GNEDataHandler& s) = delete;
107 
110 };
SumoXMLTag
Numbers representing SUMO-XML - element names.
The XML-Handler for network loading.
Definition: DataHandler.h:38
GNEDataHandler(GNENet *net, const std::string &file, const bool allowUndoRedo)
Constructor.
~GNEDataHandler()
Destructor.
void buildTAZRelationData(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &fromTAZID, const std::string &toTAZID, const std::map< std::string, std::string > &parameters)
Builds TAZRelationData.
void writeErrorInvalidParent(const SumoXMLTag tag, const SumoXMLTag parent) const
write error "invalid parent element"
void buildEdgeRelationData(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &fromEdgeID, const std::string &toEdgeID, const std::map< std::string, std::string > &parameters)
Builds edgeRelationData.
void buildDataSet(const std::string &dataSetID)
Builds DataSet (exlcusive of NETEDIT)
const bool myAllowUndoRedo
allow undo/redo
void buildEdgeData(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &edgeID, const std::map< std::string, std::string > &parameters)
Builds edgeData.
void buildDataInterval(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &dataSetID, const double begin, const double end)
Builds DataInterval.
GNEDataHandler & operator=(const GNEDataHandler &s)=delete
invalidate assignment operator
GNENet * myNet
pointer to GNENet
void writeErrorDuplicated(const SumoXMLTag tag, const std::string &id) const
write error "duplicated additional"
GNEDataHandler(const GNEDataHandler &s)=delete
invalidate copy constructor
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:42