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 
27 #include <utils/common/SUMOTime.h>
32 
33 
34 // ===========================================================================
35 // class declarations
36 // ===========================================================================
38 class GNENet;
39 class GUIEvent;
40 
41 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
49 public:
53 
55  virtual ~GNELoadThread();
56 
58  FXint run();
59 
65  void loadConfigOrNet(const std::string& file, bool isNet, bool useStartupOptions, bool newNet = false);
66 
68  void retrieveMessage(const MsgHandler::MsgType type, const std::string& msg);
69 
71  static void fillOptions(OptionsCont& oc);
72 
74  static void setDefaultOptions(OptionsCont& oc);
75 
76 protected:
78  bool initOptions();
79 
85  void submitEndAndCleanup(GNENet* net, const std::string& guiSettingsFile = "", const bool viewportFromRegistry = false);
86 
87 protected:
90 
92  std::string myFile;
93 
96 
99 
102 
104  bool myLoadNet;
105 
107  bool myNewNet;
108 };
109 
110 
111 #endif
112 
113 /****************************************************************************/
FXEX::FXThreadEvent & myEventThrow
event throw
OutputDevice * myWarningRetriever
Definition: GNELoadThread.h:95
OutputDevice * myGLDebugRetriever
Definition: GNELoadThread.h:95
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:95
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:80
MFXInterThreadEventClient * myParent
the parent window to inform about the loading
Definition: GNELoadThread.h:89
static void setDefaultOptions(OptionsCont &oc)
sets required options for proper functioning
OutputDevice * myDebugRetriever
Definition: GNELoadThread.h:95
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:98
OutputDevice * myMessageRetriever
Definition: GNELoadThread.h:95
A storage for options typed value containers)
Definition: OptionsCont.h:92
std::string myFile
the path to load the network from
Definition: GNELoadThread.h:92
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