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-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // The thread that performs the loading of a Netedit-net (adapted from
16 // GUILoadThread)
17 /****************************************************************************/
18 #ifndef GNELoadThread_h
19 #define GNELoadThread_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
31 
32 
33 // ===========================================================================
34 // class declarations
35 // ===========================================================================
36 class GNENet;
37 class GUIEvent;
38 
39 
40 // ===========================================================================
41 // class definitions
42 // ===========================================================================
47 public:
51 
53  virtual ~GNELoadThread();
54 
56  FXint run();
57 
63  void loadConfigOrNet(const std::string& file, bool isNet, bool useStartupOptions, bool newNet = false);
64 
66  void retrieveMessage(const MsgHandler::MsgType type, const std::string& msg);
67 
69  static void fillOptions(OptionsCont& oc);
70 
72  static void setDefaultOptions(OptionsCont& oc);
73 
74 protected:
76  bool initOptions();
77 
83  void submitEndAndCleanup(GNENet* net, const std::string& guiSettingsFile = "", const bool viewportFromRegistry = false);
84 
85 protected:
88 
90  std::string myFile;
91 
94 
97 
100 
102  bool myLoadNet;
103 
105  bool myNewNet;
106 };
107 
108 
109 #endif
110 
111 /****************************************************************************/
FXEX::FXThreadEvent & myEventThrow
event throw
Definition: GNELoadThread.h:99
OutputDevice * myWarningRetriever
Definition: GNELoadThread.h:93
OutputDevice * myGLDebugRetriever
Definition: GNELoadThread.h:93
void loadConfigOrNet(const std::string &file, bool isNet, bool useStartupOptions, bool newNet=false)
begins the loading of a netconvert configuration or a a network
bool initOptions()
init options
OutputDevice * myErrorRetriever
The instances of message retriever encapsulations Needed to be deleted from the handler later on...
Definition: GNELoadThread.h:93
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:77
MFXInterThreadEventClient * myParent
the parent window to inform about the loading
Definition: GNELoadThread.h:87
static void setDefaultOptions(OptionsCont &oc)
sets required options for proper functioning
OutputDevice * myDebugRetriever
Definition: GNELoadThread.h:93
bool myNewNet
if true, a new net is created
bool myLoadNet
Information whether only the network shall be loaded.
GNELoadThread(FXApp *app, MFXInterThreadEventClient *mw, MFXEventQue< GUIEvent *> &eq, FXEX::FXThreadEvent &ev)
constructor
FXint run()
starts the thread. The thread ends after the net has been loaded
MFXEventQue< GUIEvent * > & myEventQue
event Queue
Definition: GNELoadThread.h:96
OutputDevice * myMessageRetriever
Definition: GNELoadThread.h:93
A storage for options typed value containers)
Definition: OptionsCont.h:92
std::string myFile
the path to load the network from
Definition: GNELoadThread.h:90
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:64
void submitEndAndCleanup(GNENet *net, const std::string &guiSettingsFile="", const bool viewportFromRegistry=false)
Closes the loading process.
void retrieveMessage(const MsgHandler::MsgType type, const std::string &msg)
Retrieves messages from the loading module.
static void fillOptions(OptionsCont &oc)
clears and initializes the OptionsCont
virtual ~GNELoadThread()
destructor