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 /****************************************************************************/
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 /****************************************************************************/
MsgHandler::MsgType
MsgType
Definition: MsgHandler.h:51
MFXInterThreadEventClient
Definition: MFXInterThreadEventClient.h:28
GNELoadThread::myErrorRetriever
OutputDevice * myErrorRetriever
The instances of message retriever encapsulations Needed to be deleted from the handler later on.
Definition: GNELoadThread.h:93
OutputDevice
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:64
GNELoadThread::run
FXint run()
starts the thread. The thread ends after the net has been loaded
Definition: GNELoadThread.cpp:66
GNELoadThread::myLoadNet
bool myLoadNet
Information whether only the network shall be loaded.
Definition: GNELoadThread.h:102
GNENet
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:78
MsgHandler.h
GNELoadThread::retrieveMessage
void retrieveMessage(const MsgHandler::MsgType type, const std::string &msg)
Retrieves messages from the loading module.
Definition: GNELoadThread.cpp:345
GNELoadThread::myGLDebugRetriever
OutputDevice * myGLDebugRetriever
Definition: GNELoadThread.h:93
GNELoadThread::myWarningRetriever
OutputDevice * myWarningRetriever
Definition: GNELoadThread.h:93
GNELoadThread::myEventThrow
FXEX::FXThreadEvent & myEventThrow
event throw
Definition: GNELoadThread.h:99
FXSynchQue.h
GNELoadThread::~GNELoadThread
virtual ~GNELoadThread()
destructor
Definition: GNELoadThread.cpp:56
GNELoadThread::myParent
MFXInterThreadEventClient * myParent
the parent window to inform about the loading
Definition: GNELoadThread.h:87
GNELoadThread::initOptions
bool initOptions()
init options
Definition: GNELoadThread.cpp:298
GNELoadThread::myMessageRetriever
OutputDevice * myMessageRetriever
Definition: GNELoadThread.h:93
FXSingleEventThread.h
MFXInterThreadEventClient.h
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:90
GNELoadThread
Definition: GNELoadThread.h:46
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:333
GNELoadThread::submitEndAndCleanup
void submitEndAndCleanup(GNENet *net, const std::string &guiSettingsFile="", const bool viewportFromRegistry=false)
Closes the loading process.
Definition: GNELoadThread.cpp:183
GUIEvent
Definition: GUIEvent.h:77
GNELoadThread::setDefaultOptions
static void setDefaultOptions(OptionsCont &oc)
sets required options for proper functioning
Definition: GNELoadThread.cpp:290
GNELoadThread::fillOptions
static void fillOptions(OptionsCont &oc)
clears and initializes the OptionsCont
Definition: GNELoadThread.cpp:198
config.h
FXSingleEventThread
Definition: FXSingleEventThread.h:35
GNELoadThread::myNewNet
bool myNewNet
if true, a new net is created
Definition: GNELoadThread.h:105
FXEX::FXThreadEvent
Definition: FXThreadEvent.h:106
GNELoadThread::GNELoadThread
GNELoadThread(FXApp *app, MFXInterThreadEventClient *mw, FXSynchQue< GUIEvent * > &eq, FXEX::FXThreadEvent &ev)
constructor
Definition: GNELoadThread.cpp:44
GNELoadThread::myDebugRetriever
OutputDevice * myDebugRetriever
Definition: GNELoadThread.h:93
GNELoadThread::myEventQue
FXSynchQue< GUIEvent * > & myEventQue
event Queue
Definition: GNELoadThread.h:96
GNELoadThread::myFile
std::string myFile
the path to load the network from
Definition: GNELoadThread.h:90