Eclipse SUMO - Simulation of Urban MObility
GNELoadThread.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3// Copyright (C) 2001-2022 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18// The thread that performs the loading of a Netedit-net (adapted from
19// GUILoadThread)
20/****************************************************************************/
21#pragma once
22#include <config.h>
23
28
29
30// ===========================================================================
31// class declarations
32// ===========================================================================
33class GNENet;
34class GUIEvent;
35
36
37// ===========================================================================
38// class definitions
39// ===========================================================================
44public:
48
50 virtual ~GNELoadThread();
51
53 FXint run();
54
60 void loadConfigOrNet(const std::string& file, const bool isNet, const bool useStartupOptions, const bool newNet = false);
61
63 void retrieveMessage(const MsgHandler::MsgType type, const std::string& msg);
64
66 static void fillOptions(OptionsCont& oc);
67
69 static void setDefaultOptions(OptionsCont& oc);
70
71protected:
73 bool initOptions();
74
80 void submitEndAndCleanup(GNENet* net, const bool newNet = false, const std::string& guiSettingsFile = "", const bool viewportFromRegistry = false);
81
82protected:
85
87 std::string myFile;
88
91
94
97
99 bool myLoadNet = false;
100
102 bool myNewNet = false;
103};
OutputDevice * myErrorRetriever
The instances of message retriever encapsulations Needed to be deleted from the handler later on.
Definition: GNELoadThread.h:90
void retrieveMessage(const MsgHandler::MsgType type, const std::string &msg)
Retrieves messages from the loading module.
void loadConfigOrNet(const std::string &file, const bool isNet, const bool useStartupOptions, const bool newNet=false)
begins the loading of a netconvert configuration or a a network
OutputDevice * myWarningRetriever
Definition: GNELoadThread.h:90
GNELoadThread(FXApp *app, MFXInterThreadEventClient *mw, MFXSynchQue< GUIEvent * > &eq, FXEX::MFXThreadEvent &ev)
constructor
bool myNewNet
if true, a new net is created
MFXInterThreadEventClient * myParent
the parent window to inform about the loading
Definition: GNELoadThread.h:84
OutputDevice * myMessageRetriever
Definition: GNELoadThread.h:90
virtual ~GNELoadThread()
destructor
MFXSynchQue< GUIEvent * > & myEventQue
event Queue
Definition: GNELoadThread.h:93
OutputDevice * myGLDebugRetriever
Definition: GNELoadThread.h:90
std::string myFile
the path to load the network from
Definition: GNELoadThread.h:87
OutputDevice * myDebugRetriever
Definition: GNELoadThread.h:90
static void fillOptions(OptionsCont &oc)
clears and initializes the OptionsCont
bool initOptions()
init options
bool myLoadNet
Information whether only the network shall be loaded.
Definition: GNELoadThread.h:99
FXEX::MFXThreadEvent & myEventThrow
event throw
Definition: GNELoadThread.h:96
static void setDefaultOptions(OptionsCont &oc)
sets required options for proper functioning
FXint run()
starts the thread. The thread ends after the net has been loaded
void submitEndAndCleanup(GNENet *net, const bool newNet=false, const std::string &guiSettingsFile="", const bool viewportFromRegistry=false)
Closes the loading process.
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:42
A storage for options typed value containers)
Definition: OptionsCont.h:89
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:61