Eclipse SUMO - Simulation of Urban MObility
MeanDataHandler.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 // The XML-Handler for meanMeanData elements loading
19 /****************************************************************************/
20 #pragma once
21 #include <config.h>
22 
25 
26 
27 // ===========================================================================
28 // class definitions
29 // ===========================================================================
39 
40 public:
43 
45  virtual ~MeanDataHandler();
46 
48  bool beginParseAttributes(SumoXMLTag tag, const SUMOSAXAttributes& attrs);
49 
51  void endParseAttributes();
52 
55 
59  virtual void buildEdgeMeanData(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& ID,
60  const std::string& file, SUMOTime period, SUMOTime begin, SUMOTime end, const bool trackVehicles,
61  const std::vector<std::string>& writtenAttributes, const bool aggregate, const std::vector<std::string>& edges,
62  const std::string& edgeFile, std::string excludeEmpty, const bool withInternal,
63  const std::vector<std::string>& detectPersons, const double minSamples, const double maxTravelTime,
64  const std::vector<std::string>& vTypes, const double speedThreshold) = 0;
65 
67  virtual void buildLaneMeanData(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& ID,
68  const std::string& file, SUMOTime period, SUMOTime begin, SUMOTime end, const bool trackVehicles,
69  const std::vector<std::string>& writtenAttributes, const bool aggregate, const std::vector<std::string>& edges,
70  const std::string& edgeFile, std::string excludeEmpty, const bool withInternal,
71  const std::vector<std::string>& detectPersons, const double minSamples, const double maxTravelTime,
72  const std::vector<std::string>& vTypes, const double speedThreshold) = 0;
73 
75 
77  bool isErrorCreatingElement() const;
78 
79 protected:
81  void writeError(const std::string& error);
82 
83 private:
86 
88  bool myErrorCreatingElement = false;
89 
93  void parseEdgeMeanData(const SUMOSAXAttributes& attrs);
94 
96  void parseLaneMeanData(const SUMOSAXAttributes& attrs);
97 
99 
101  MeanDataHandler(const MeanDataHandler& s) = delete;
102 
105 };
long long int SUMOTime
Definition: GUI.h:35
SumoXMLTag
Numbers representing SUMO-XML - element names.
The XML-Handler for network loading.
bool beginParseAttributes(SumoXMLTag tag, const SUMOSAXAttributes &attrs)
begin parse attributes
void endParseAttributes()
end parse attributes
virtual void buildEdgeMeanData(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &ID, const std::string &file, SUMOTime period, SUMOTime begin, SUMOTime end, const bool trackVehicles, const std::vector< std::string > &writtenAttributes, const bool aggregate, const std::vector< std::string > &edges, const std::string &edgeFile, std::string excludeEmpty, const bool withInternal, const std::vector< std::string > &detectPersons, const double minSamples, const double maxTravelTime, const std::vector< std::string > &vTypes, const double speedThreshold)=0
bool isErrorCreatingElement() const
get flag for check if a element wasn't created
MeanDataHandler(const MeanDataHandler &s)=delete
invalidate copy constructor
MeanDataHandler()
Constructor.
void writeError(const std::string &error)
write error and enable error creating element
void parseEdgeMeanData(const SUMOSAXAttributes &attrs)
virtual ~MeanDataHandler()
Destructor.
void parseLaneMeanData(const SUMOSAXAttributes &attrs)
parse laneMeanData attributes
CommonXMLStructure myCommonXMLStructure
common XML Structure
void parseSumoBaseObject(CommonXMLStructure::SumoBaseObject *obj)
parse SumoBaseObject (it's called recursivelly)
virtual void buildLaneMeanData(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &ID, const std::string &file, SUMOTime period, SUMOTime begin, SUMOTime end, const bool trackVehicles, const std::vector< std::string > &writtenAttributes, const bool aggregate, const std::vector< std::string > &edges, const std::string &edgeFile, std::string excludeEmpty, const bool withInternal, const std::vector< std::string > &detectPersons, const double minSamples, const double maxTravelTime, const std::vector< std::string > &vTypes, const double speedThreshold)=0
Builds laneMeanData.
MeanDataHandler & operator=(const MeanDataHandler &s)=delete
invalidate assignment operator
bool myErrorCreatingElement
flag for check if a element wasn't created
Encapsulated SAX-Attributes.