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-2015 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 
66  FXint run();
67 
73  void loadConfigOrNet(const std::string& file, bool isNet, bool optionsReady = false, bool newNet = false);
74 
76  void retrieveMessage(const MsgHandler::MsgType type, const std::string& msg);
77 
79  static void fillOptions(OptionsCont& oc);
80 
82  static void setDefaultOptions(OptionsCont& oc);
83 
84 protected:
85  bool initOptions();
86 
87 
93  void submitEndAndCleanup(GNENet* net, const std::string& guiSettingsFile = "", const bool viewportFromRegistry = false);
94 
95 protected:
98 
100  std::string myFile;
101 
105 
107 
109 
111  bool myLoadNet;
112 
115 
117  bool myNewNet;
118 };
119 
120 
121 #endif
122 
123 /****************************************************************************/
FXEX::FXThreadEvent & myEventThrow
OutputDevice * myWarningRetriever
GNELoadThread(FXApp *app, MFXInterThreadEventClient *mw, MFXEventQue< GUIEvent * > &eq, FXEX::FXThreadEvent &ev)
constructor
bool myOptionsReady
if true, options will not be read from myFile
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:77
MFXInterThreadEventClient * myParent
the parent window to inform about the loading
Definition: GNELoadThread.h:97
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.
MFXEventQue< GUIEvent * > & myEventQue
OutputDevice * myMessageRetriever
A storage for options typed value containers)
Definition: OptionsCont.h:108
std::string myFile
the path to load the simulation from
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
void loadConfigOrNet(const std::string &file, bool isNet, bool optionsReady=false, bool newNet=false)
begins the loading of a netconvert configuration or a a network
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