Path: blob/main/src/netedit/elements/data/GNEDataHandler.h
193994 views
/****************************************************************************/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 GNEDataHandler.h14/// @author Pablo Alvarez Lopez15/// @date Jan 202016///17// Builds data objects for netedit18/****************************************************************************/19#pragma once20#include <config.h>2122#include <utils/handlers/DataHandler.h>232425// ===========================================================================26// class declarations27// ===========================================================================28class GNENet;2930// ===========================================================================31// class definitions32// ===========================================================================3334class GNEDataHandler : public DataHandler {3536public:37/**@brief Constructor38* @param[in] net GNENet39* @param[in] bucket FileBucket in which place the element40* @param[in] allowUndoRedo enable or disable undoRedo41*/42GNEDataHandler(GNENet* net, FileBucket* fileBucket, const bool allowUndoRedo);4344/// @brief Destructor45~GNEDataHandler();4647/// @name build functions48/// @{49/**@brief Builds DataSet (exclusive of netedit)50* @param[in] dataSetID new dataSet51*/52bool buildDataSet(const std::string& id);5354/**@brief Builds DataInterval55* @param[in] sumoBaseObject sumo base object used for build56* @param[in] dataSetID interval's dataSet57* @param[in] begin interval begin58* @param[in] end interval end59*/60bool buildDataInterval(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& dataSetID,61const double begin, const double end);6263/**@brief Builds edgeData64* @param[in] sumoBaseObject sumo base object used for build65* @param[in] edgeID edge ID66* @param[in] parameters parameters map67*/68bool buildEdgeData(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& edgeID,69const Parameterised::Map& parameters);7071/**@brief Builds edgeRelationData72* @param[in] sumoBaseObject sumo base object used for build73* @param[in] fromEdge edge from74* @param[in] toEdge edge to75* @param[in] parameters parameters map76*/77bool buildEdgeRelationData(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& fromEdgeID,78const std::string& toEdgeID, const Parameterised::Map& parameters);7980/**@brief Builds TAZRelationData81* @param[in] sumoBaseObject sumo base object used for build82* @param[in] fromTAZ TAZ from83* @param[in] toTAZ TAZ to84* @param[in] parameters parameters map85*/86bool buildTAZRelationData(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& fromTAZID,87const std::string& toTAZID, const Parameterised::Map& parameters);88/// @}8990protected:91/// @brief pointer to GNENet92GNENet* myNet;9394/// @brief allow undo/redo95const bool myAllowUndoRedo;9697/// @brief check if given ID correspond to a duplicated dataSet98bool checkDuplicatedDataSet(const std::string& id);99100private:101/// @brief invalidate default constructor102GNEDataHandler() = delete;103104/// @brief invalidate copy constructor105GNEDataHandler(const GNEDataHandler& s) = delete;106107/// @brief invalidate assignment operator108GNEDataHandler& operator=(const GNEDataHandler& s) = delete;109};110111112