/****************************************************************************/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 GeneralHandler.h14/// @author Pablo Alvarez Lopez15/// @date Sep 202116///17// General element handler18/****************************************************************************/19#pragma once20#include <config.h>2122#include <utils/xml/SUMOSAXHandler.h>2324// ===========================================================================25// class definitions26// ===========================================================================2728class GeneralHandler : public SUMOSAXHandler {2930public:31/**@brief Constructor32* @param[in] file Name of the parsed file33*/34GeneralHandler(const std::string& file);3536/// @brief Destructor37~GeneralHandler();3839/// @brief parse40bool parse();4142private:43/// @brief start element44virtual void beginTag(SumoXMLTag tag, const SUMOSAXAttributes& attrs) = 0;4546/// @brief end element47virtual void endTag() = 0;4849/// @brief run post parser tasks50virtual bool postParserTasks() = 0;5152/// @name inherited from SUMOSAXHandler53/// @{54/** @brief Called on the opening of a tag;55*56* @param[in] element ID of the currently opened element57* @param[in] attrs Attributes within the currently opened element58* @exception ProcessError If something fails59* @see GenericSAXHandler::myStartElement60* @todo Refactor/describe61*/62void myStartElement(int element, const SUMOSAXAttributes& attrs);6364/** @brief Called when a closing tag occurs65*66* @param[in] element ID of the currently opened element67* @exception ProcessError If something fails68* @see GenericSAXHandler::myEndElement69* @todo Refactor/describe70*/71void myEndElement(int element);7273/// @}7475/// @brief invalidate default onstructor76GeneralHandler() = delete;7778/// @brief invalidate copy constructor79GeneralHandler(const GeneralHandler& s) = delete;8081/// @brief invalidate assignment operator82GeneralHandler& operator=(const GeneralHandler& s) = delete;83};8485/****************************************************************************/868788