Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEDataHandler.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// Builds data objects for netedit
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
24
25
26// ===========================================================================
27// class declarations
28// ===========================================================================
29class GNENet;
30
31// ===========================================================================
32// class definitions
33// ===========================================================================
34
37
38public:
45 GNEDataHandler(GNENet* net, const std::string& file, const bool allowUndoRedo, const bool overwrite);
46
49
52
55 void buildDataSet(const std::string& dataSetID);
56
63 void buildDataInterval(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& dataSetID,
64 const double begin, const double end);
65
71 void buildEdgeData(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& edgeID,
72 const Parameterised::Map& parameters);
73
80 void buildEdgeRelationData(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& fromEdgeID,
81 const std::string& toEdgeID, const Parameterised::Map& parameters);
82
89 void buildTAZRelationData(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& fromTAZID,
90 const std::string& toTAZID, const Parameterised::Map& parameters);
92
93protected:
96
98 const bool myAllowUndoRedo;
99
101 const bool myOverwrite;
102
104 void writeErrorDuplicated(const SumoXMLTag tag, const std::string& id);
105
107 void writeErrorInvalidParent(const SumoXMLTag tag, const SumoXMLTag parent);
108
110 void writeErrorInvalidParent(const SumoXMLTag tag, const SumoXMLTag parent, const std::string& id);
111
112private:
114 GNEDataHandler(const GNEDataHandler& s) = delete;
115
118};
SumoXMLTag
Numbers representing SUMO-XML - element names.
The XML-Handler for network loading.
Definition DataHandler.h:38
~GNEDataHandler()
Destructor.
void buildDataSet(const std::string &dataSetID)
Builds DataSet (exclusive of netedit)
void buildTAZRelationData(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &fromTAZID, const std::string &toTAZID, const Parameterised::Map &parameters)
Builds TAZRelationData.
const bool myAllowUndoRedo
allow undo/redo
void writeErrorDuplicated(const SumoXMLTag tag, const std::string &id)
write error "duplicated additional"
void writeErrorInvalidParent(const SumoXMLTag tag, const SumoXMLTag parent)
write error "invalid parent element"
const bool myOverwrite
check if overwrite
void buildEdgeData(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &edgeID, const Parameterised::Map &parameters)
Builds edgeData.
void buildDataInterval(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &dataSetID, const double begin, const double end)
Builds DataInterval.
void buildEdgeRelationData(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &fromEdgeID, const std::string &toEdgeID, const Parameterised::Map &parameters)
Builds edgeRelationData.
GNENet * myNet
pointer to GNENet
GNEDataHandler & operator=(const GNEDataHandler &s)=delete
invalidate assignment operator
GNEDataHandler(const GNEDataHandler &s)=delete
invalidate copy constructor
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
std::map< std::string, std::string > Map
parameters map