/****************************************************************************/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 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>2728#include "GNEEvent_FileLoaded.h"2930// ===========================================================================31// class declarations32// ===========================================================================3334class GNEApplicationWindow;3536// ===========================================================================37// class definitions38// ===========================================================================3940class GNELoadThread : protected MFXSingleEventThread {4142public:43/// @brief constructor44GNELoadThread(GNEApplicationWindow* applicationWindow, MFXSynchQue<GUIEvent*>& eq, FXEX::MFXThreadEvent& ev);4546/// @brief destructor47virtual ~GNELoadThread();4849/// @brief starts the thread. The thread ends after the net has been loaded50FXint run();5152/// @brief begins the creation of an empty network53void newNetwork();5455/// @brief begins the loading of an existent network or config56void loadNetworkOrConfig();5758/// @brief Retrieves messages from the loading module59void retrieveMessage(const MsgHandler::MsgType type, const std::string& msg);6061/// @brief clears and initializes the OptionsCont62static void fillOptions(OptionsCont& neteditOptions);6364/// @brief sets required options for proper functioning65static void setDefaultOptions(OptionsCont& neteditOptions);6667private:68/// @brief load options through console69bool loadConsoleOptions();7071/**@brief Closes the loading process72*73* This method is called both on success and failure.74* All message callbacks to this instance are removed and the parent75* application is informed about the loading76*/77FXint submitEndAndCleanup(GNEEvent_FileLoaded::Type type, GNENet* net, const std::string& loadedFile,78const std::string& guiSettingsFile = "", const bool viewportFromRegistry = false);7980/// @brief netedit application windows81GNEApplicationWindow* myApplicationWindow;8283/// @brief @brief The instances of message retriever encapsulations Needed to be deleted from the handler later on84OutputDevice* myErrorRetriever, *myMessageRetriever, *myWarningRetriever, *myDebugRetriever, *myGLDebugRetriever;8586/// @brief event Queue87MFXSynchQue<GUIEvent*>& myEventQueue;8889/// @brief event throw90FXEX::MFXThreadEvent& myEventThrow;91};929394