/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file MeanDataHandler.h14/// @author Pablo Alvarez Lopez15/// @date Nov 202216///17// The XML-Handler for meanMeanData elements loading18/****************************************************************************/19#pragma once20#include <config.h>2122#include "CommonHandler.h"2324// ===========================================================================25// class definitions26// ===========================================================================27/**28* @class MeanDataHandler29* @brief The XML-Handler for network loading30*31* The SAX2-handler responsible for parsing networks and routes to load.32* This is an extension of the MSRouteHandler as routes and vehicles may also33* be loaded from network descriptions.34*/35class MeanDataHandler : public CommonHandler {3637public:38/// @brief Constructor39MeanDataHandler(const std::string& filename);4041/// @brief Destructor42virtual ~MeanDataHandler();4344/// @brief begin parse attributes45bool beginParseAttributes(SumoXMLTag tag, const SUMOSAXAttributes& attrs);4647/// @brief end parse attributes48void endParseAttributes();4950/// @brief parse SumoBaseObject (it's called recursivelly)51void parseSumoBaseObject(CommonXMLStructure::SumoBaseObject* obj);5253/// @brief run post parser tasks54virtual bool postParserTasks() = 0;5556/// @name build functions57/// @{58/// @brief Builds edgeMeanData59virtual bool buildEdgeMeanData(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& ID,60const std::string& file, SUMOTime period, SUMOTime begin, SUMOTime end, const bool trackVehicles,61const std::vector<std::string>& writtenAttributes, const bool aggregate, const std::vector<std::string>& edges,62const std::string& edgeFile, std::string excludeEmpty, const bool withInternal,63const std::vector<std::string>& detectPersons, const double minSamples, const double maxTravelTime,64const std::vector<std::string>& vTypes, const double speedThreshold) = 0;6566/// @brief Builds laneMeanData67virtual bool buildLaneMeanData(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& ID,68const std::string& file, SUMOTime period, SUMOTime begin, SUMOTime end, const bool trackVehicles,69const std::vector<std::string>& writtenAttributes, const bool aggregate, const std::vector<std::string>& edges,70const std::string& edgeFile, std::string excludeEmpty, const bool withInternal,71const std::vector<std::string>& detectPersons, const double minSamples, const double maxTravelTime,72const std::vector<std::string>& vTypes, const double speedThreshold) = 0;7374/// @}7576private:77/// @name parse meanMeanData attributes78/// @{79/// @brief parse edgeMeanData attributes80void parseEdgeMeanData(const SUMOSAXAttributes& attrs);8182/// @brief parse laneMeanData attributes83void parseLaneMeanData(const SUMOSAXAttributes& attrs);8485/// @}8687/// @brief invalidate default onstructor88MeanDataHandler() = delete;8990/// @brief invalidate copy constructor91MeanDataHandler(const MeanDataHandler& s) = delete;9293/// @brief invalidate assignment operator94MeanDataHandler& operator=(const MeanDataHandler& s) = delete;95};969798