SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GUIRunThread.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // The thread that runs the simulation
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
12 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef GUIRunThread_h
23 #define GUIRunThread_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <string>
36 #include <iostream>
37 #include <fx.h>
42 #include <utils/common/SUMOTime.h>
43 
44 
45 // ===========================================================================
46 // class declarations
47 // ===========================================================================
48 class GUINet;
49 class OutputDevice;
50 
51 
52 // ===========================================================================
53 // class definition
54 // ===========================================================================
63 public:
66  FXRealSpinDial& simDelay, MFXEventQue& eq, FXEX::FXThreadEvent& ev);
67 
69  virtual ~GUIRunThread();
70 
72  virtual bool init(GUINet* net, SUMOTime start, SUMOTime end);
73 
75  virtual FXint run();
76 
79  void resume();
80 
83  void singleStep();
84 
86  virtual void begin();
87 
89  void stop();
90 
92  bool simulationAvailable() const;
93 
94  virtual bool simulationIsStartable() const;
95  virtual bool simulationIsStopable() const;
96  virtual bool simulationIsStepable() const;
97 
99  virtual void deleteSim();
100 
102  GUINet& getNet() const;
103 
105  void prepareDestruction();
106 
108  void retrieveMessage(const MsgHandler::MsgType type, const std::string& msg);
109 
110 protected:
111  void makeStep();
112 
113 protected:
116 
119 
121  bool myHalting;
122 
125  bool myQuit;
126 
131 
132  bool myOk;
133 
135  bool mySingle;
136 
140 
142 
144 
146 
148 
149 };
150 
151 
152 #endif
153 
154 /****************************************************************************/
155