/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2014-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 ODAmitranHandler.h14/// @author Michael Behrisch15/// @date 27.03.201416///17// An XML-Handler for Amitran OD matrices18/****************************************************************************/19#pragma once20#include <config.h>2122#include <string>23#include <utility>24#include <utils/xml/SUMOSAXHandler.h>252627// ===========================================================================28// class declarations29// ===========================================================================30class ODMatrix;313233// ===========================================================================34// class definitions35// ===========================================================================36/**37* @class ODAmitranHandler38* @brief An XML-Handler for districts39*40* This SUMOSAXHandler parses OD matrices in the Amitran format.41*/42class ODAmitranHandler : public SUMOSAXHandler {43public:44/** @brief Constructor45*46* Saves the given matrix in order to fill it.47* @param[in] cont The matrix to fill48* @param[in] file The file that will be processed49*/50ODAmitranHandler(ODMatrix& matrix, const std::string& file);515253/// @brief Destructor54~ODAmitranHandler();555657protected:58/// @name inherited from GenericSAXHandler59//@{6061/** @brief Called when an opening-tag occurs62*63* Processes district elements via openDistrict, their sinks (via64* addSink) and sources (via addSource).65*66* @param[in] element The enum of the currently opened element67* @param[in] attrs Attributes of the currently opened element68* @exception ProcessError If an error within the parsed file occurs69* @see GenericSAXHandler::myStartElement70*/71void myStartElement(int element,72const SUMOSAXAttributes& attrs);73//@}747576private:77/// The matrix to add demand to78ODMatrix& myMatrix;7980std::string myVehicleType;8182SUMOTime myBegin;83SUMOTime myEnd;84private:85/// @brief invalidated copy constructor86ODAmitranHandler(const ODAmitranHandler& s);8788/// @brief invalidated assignment operator89ODAmitranHandler& operator=(const ODAmitranHandler& s);909192};939495