SUMO - Simulation of Urban MObility
GNELoadThread.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // The thread that performs the loading of a Netedit-net (adapted from
8 // GUILoadThread)
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright (C) 2001-2016 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef GNELoadThread_h
22 #define GNELoadThread_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <utils/common/SUMOTime.h>
39 
40 
41 // ===========================================================================
42 // class declarations
43 // ===========================================================================
45 class GNENet;
46 class GUIEvent;
47 
48 
49 // ===========================================================================
50 // class definitions
51 // ===========================================================================
56 public:
60 
62  virtual ~GNELoadThread();
63 
65  FXint run();
66 
72  void loadConfigOrNet(const std::string& file, bool isNet, bool useStartupOptions, bool newNet = false);
73 
75  void retrieveMessage(const MsgHandler::MsgType type, const std::string& msg);
76 
78  static void fillOptions(OptionsCont& oc);
79 
81  static void setDefaultOptions(OptionsCont& oc);
82 
83 protected:
85  bool initOptions();
86 
92  void submitEndAndCleanup(GNENet* net, const std::string& guiSettingsFile = "", const bool viewportFromRegistry = false);
93 
94 protected:
97 
99  std::string myFile;
100 
103 
106 
109 
111  bool myLoadNet;
112 
114  bool myNewNet;
115 
117  std::string myAdditionalFile;
118 
121 };
122 
123 
124 #endif
125 
126 /****************************************************************************/
FXEX::FXThreadEvent & myEventThrow
event throw
OutputDevice * myWarningRetriever
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...
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:87
MFXInterThreadEventClient * myParent
the parent window to inform about the loading
Definition: GNELoadThread.h:96
std::string myAdditionalOutputFile
filename for the additionals output
static void setDefaultOptions(OptionsCont &oc)
sets required options for proper functioning
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
std::string myAdditionalFile
filename with additionals input
OutputDevice * myMessageRetriever
A storage for options typed value containers)
Definition: OptionsCont.h:99
std::string myFile
the path to load the simulation from
Definition: GNELoadThread.h:99
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
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