/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2026 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 METypeHandler.h14/// @author Jakob Erdmann15/// @date Jan 202616///17// The XML-Handler for loading meso edge types18// This is a dedicated handler because meso types must be loaded from additional19// files before any other objects are loaded from them20/****************************************************************************/21#pragma once22#include <config.h>2324#include <utils/xml/SUMOSAXHandler.h>2526// ===========================================================================27// class definitions28// ===========================================================================2930class MSNet;3132/**33* @class METypeHandler34* @brief The XML-Handler for meso edge type loading35*/36class METypeHandler : public SUMOSAXHandler {3738public:39/** @brief Constructor40*41* @param[in] file Name of the parsed file42* @param[in, out] net The network to fill43* @param[in] detBuilder The detector builder to use44* @param[in] triggerBuilder The trigger builder to use45* @param[in] edgeBuilder The builder of edges to use46* @param[in] junctionBuilder The builder of junctions to use47*/48METypeHandler(const std::string& file, MSNet& net);495051/// @brief Destructor52virtual ~METypeHandler();5354bool haveSeenMesoEdgeType() const {55return myHaveSeenMesoEdgeType;56}575859protected:60/// @name inherited from GenericSAXHandler61//@{6263/** @brief Called on the opening of a tag;64*65* @param[in] element ID of the currently opened element66* @param[in] attrs Attributes within the currently opened element67* @exception ProcessError If something fails68* @see GenericSAXHandler::myStartElement69* @todo Refactor/describe70*/71void myStartElement(int element, const SUMOSAXAttributes& attrs);727374/** @brief Called when a closing tag occurs75*76* @param[in] element ID of the currently opened element77* @exception ProcessError If something fails78* @see GenericSAXHandler::myEndElement79* @todo Refactor/describe80*/81void myEndElement(int element);82//@}838485protected:86/** @brief Loads edge type specific meso parameters87* @param[in] attrs The attributes that hold the parameters88*/89void addMesoEdgeType(const SUMOSAXAttributes& attrs);909192protected:93/// @brief The net to fill (preinitialised)94MSNet& myNet;9596/// The id of the currently processed edge type97std::string myCurrentTypeID;9899/// @brief whether edge type specific meso parameters were loaded100bool myHaveSeenMesoEdgeType;101102private:103/** invalid copy constructor */104METypeHandler(const METypeHandler& s);105106/** invalid assignment operator */107METypeHandler& operator=(const METypeHandler& s);108109};110111112