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-2019 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 /****************************************************************************/
14 // The thread that performs the loading of a Netedit-net (adapted from
15 // GUILoadThread)
16 /****************************************************************************/
17 #ifndef GNELoadThread_h
18 #define GNELoadThread_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
30 
31 
32 // ===========================================================================
33 // class declarations
34 // ===========================================================================
35 class GNENet;
36 class GUIEvent;
37 
38 
39 // ===========================================================================
40 // class definitions
41 // ===========================================================================
46 public:
50 
52  virtual ~GNELoadThread();
53 
55  FXint run();
56 
62  void loadConfigOrNet(const std::string& file, bool isNet, bool useStartupOptions, bool newNet = false);
63 
65  void retrieveMessage(const MsgHandler::MsgType type, const std::string& msg);
66 
68  static void fillOptions(OptionsCont& oc);
69 
71  static void setDefaultOptions(OptionsCont& oc);
72 
73 protected:
75  bool initOptions();
76 
82  void submitEndAndCleanup(GNENet* net, const std::string& guiSettingsFile = "", const bool viewportFromRegistry = false);
83 
84 protected:
87 
89  std::string myFile;
90 
93 
96 
99 
101  bool myLoadNet;
102 
104  bool myNewNet;
105 };
106 
107 
108 #endif
109 
110 /****************************************************************************/
MsgHandler::MsgType
MsgType
Definition: MsgHandler.h:45
MFXInterThreadEventClient
Definition: MFXInterThreadEventClient.h:27
GNELoadThread::myErrorRetriever
OutputDevice * myErrorRetriever
The instances of message retriever encapsulations Needed to be deleted from the handler later on.
Definition: GNELoadThread.h:92
OutputDevice
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:63
GNELoadThread::run
FXint run()
starts the thread. The thread ends after the net has been loaded
Definition: GNELoadThread.cpp:65
GNELoadThread::myLoadNet
bool myLoadNet
Information whether only the network shall be loaded.
Definition: GNELoadThread.h:101
GNENet
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:77
MsgHandler.h
GNELoadThread::retrieveMessage
void retrieveMessage(const MsgHandler::MsgType type, const std::string &msg)
Retrieves messages from the loading module.
Definition: GNELoadThread.cpp:352
GNELoadThread::myGLDebugRetriever
OutputDevice * myGLDebugRetriever
Definition: GNELoadThread.h:92
GNELoadThread::myWarningRetriever
OutputDevice * myWarningRetriever
Definition: GNELoadThread.h:92
GNELoadThread::myEventThrow
FXEX::FXThreadEvent & myEventThrow
event throw
Definition: GNELoadThread.h:98
FXSynchQue.h
GNELoadThread::~GNELoadThread
virtual ~GNELoadThread()
destructor
Definition: GNELoadThread.cpp:55
GNELoadThread::myParent
MFXInterThreadEventClient * myParent
the parent window to inform about the loading
Definition: GNELoadThread.h:86
GNELoadThread::initOptions
bool initOptions()
init options
Definition: GNELoadThread.cpp:305
GNELoadThread::myMessageRetriever
OutputDevice * myMessageRetriever
Definition: GNELoadThread.h:92
FXSingleEventThread.h
MFXInterThreadEventClient.h
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:89
GNELoadThread
Definition: GNELoadThread.h:45
FXSynchQue< GUIEvent * >
GNELoadThread::loadConfigOrNet
void loadConfigOrNet(const std::string &file, bool isNet, bool useStartupOptions, bool newNet=false)
begins the loading of a netconvert configuration or a a network
Definition: GNELoadThread.cpp:340
GNELoadThread::submitEndAndCleanup
void submitEndAndCleanup(GNENet *net, const std::string &guiSettingsFile="", const bool viewportFromRegistry=false)
Closes the loading process.
Definition: GNELoadThread.cpp:185
GUIEvent
Definition: GUIEvent.h:76
GNELoadThread::setDefaultOptions
static void setDefaultOptions(OptionsCont &oc)
sets required options for proper functioning
Definition: GNELoadThread.cpp:297
GNELoadThread::fillOptions
static void fillOptions(OptionsCont &oc)
clears and initializes the OptionsCont
Definition: GNELoadThread.cpp:200
config.h
FXSingleEventThread
Definition: FXSingleEventThread.h:34
GNELoadThread::myNewNet
bool myNewNet
if true, a new net is created
Definition: GNELoadThread.h:104
FXEX::FXThreadEvent
Definition: FXThreadEvent.h:105
GNELoadThread::GNELoadThread
GNELoadThread(FXApp *app, MFXInterThreadEventClient *mw, FXSynchQue< GUIEvent * > &eq, FXEX::FXThreadEvent &ev)
constructor
Definition: GNELoadThread.cpp:43
GNELoadThread::myDebugRetriever
OutputDevice * myDebugRetriever
Definition: GNELoadThread.h:92
GNELoadThread::myEventQue
FXSynchQue< GUIEvent * > & myEventQue
event Queue
Definition: GNELoadThread.h:95
GNELoadThread::myFile
std::string myFile
the path to load the network from
Definition: GNELoadThread.h:89