/****************************************************************************/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 GNELoadThread.h14/// @author Jakob Erdmann15/// @date Feb 201116///17// The thread that performs the loading of a Netedit-net (adapted from18// GUILoadThread)19/****************************************************************************/20#pragma once21#include <config.h>2223#include <utils/common/MsgHandler.h>24#include <utils/foxtools/MFXSingleEventThread.h>25#include <utils/foxtools/MFXSynchQue.h>26#include <utils/foxtools/MFXInterThreadEventClient.h>272829// ===========================================================================30// class declarations31// ===========================================================================32class GNENet;33class GUIEvent;34class GNEApplicationWindow;3536// ===========================================================================37// class definitions38// ===========================================================================39/**40* @class GNELoadThread41*/42class GNELoadThread : protected MFXSingleEventThread {4344public:45/// @brief constructor46GNELoadThread(GNEApplicationWindow* applicationWindow, MFXSynchQue<GUIEvent*>& eq, FXEX::MFXThreadEvent& ev);4748/// @brief destructor49virtual ~GNELoadThread();5051/// @brief starts the thread. The thread ends after the net has been loaded52FXint run();5354/// @brief begins the creation of an empty network55void newNetwork();5657/// @brief begins the loading of an existent network or config58void loadNetworkOrConfig();5960/// @brief Retrieves messages from the loading module61void retrieveMessage(const MsgHandler::MsgType type, const std::string& msg);6263/// @brief clears and initializes the OptionsCont64static void fillOptions(OptionsCont& neteditOptions);6566/// @brief sets required options for proper functioning67static void setDefaultOptions(OptionsCont& neteditOptions);6869private:70/// @brief load options through console71bool loadConsoleOptions();7273/**@brief Closes the loading process74*75* This method is called both on success and failure.76* All message callbacks to this instance are removed and the parent77* application is informed about the loading78*/79void submitEndAndCleanup(GNENet* net, const std::string& loadedFile, const std::string& guiSettingsFile = "", const bool viewportFromRegistry = false);8081/// @brief netedit application windows82GNEApplicationWindow* myApplicationWindow;8384/// @brief @brief The instances of message retriever encapsulations Needed to be deleted from the handler later on85OutputDevice* myErrorRetriever, *myMessageRetriever, *myWarningRetriever, *myDebugRetriever, *myGLDebugRetriever;8687/// @brief event Queue88MFXSynchQue<GUIEvent*>& myEventQueue;8990/// @brief event throw91FXEX::MFXThreadEvent& myEventThrow;92};939495