SUMO - Simulation of Urban MObility
GUILoadThread.h
Go to the documentation of this file.
00001 /****************************************************************************/
00009 // Class describing the thread that performs the loading of a simulation
00010 /****************************************************************************/
00011 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00012 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
00013 /****************************************************************************/
00014 //
00015 //   This file is part of SUMO.
00016 //   SUMO is free software: you can redistribute it and/or modify
00017 //   it under the terms of the GNU General Public License as published by
00018 //   the Free Software Foundation, either version 3 of the License, or
00019 //   (at your option) any later version.
00020 //
00021 /****************************************************************************/
00022 #ifndef GUILoadThread_h
00023 #define GUILoadThread_h
00024 
00025 
00026 // ===========================================================================
00027 // included modules
00028 // ===========================================================================
00029 #ifdef _MSC_VER
00030 #include <windows_config.h>
00031 #else
00032 #include <config.h>
00033 #endif
00034 
00035 #include <utils/common/SUMOTime.h>
00036 #include <utils/foxtools/FXSingleEventThread.h>
00037 #include <utils/foxtools/FXThreadEvent.h>
00038 #include <utils/common/MsgHandler.h>
00039 
00040 
00041 // ===========================================================================
00042 // class declarations
00043 // ===========================================================================
00044 class MFXInterThreadEventClient;
00045 class MFXEventQue;
00046 class GUINet;
00047 
00048 
00049 // ===========================================================================
00050 // class definitions
00051 // ===========================================================================
00055 class GUILoadThread : public FXSingleEventThread {
00056 public:
00058     GUILoadThread(FXApp* app, MFXInterThreadEventClient* mw, MFXEventQue& eq,
00059                   FXEX::FXThreadEvent& ev);
00060 
00062     virtual ~GUILoadThread();
00063 
00066     FXint run();
00067 
00069     void load(const std::string& file, bool isNet);
00070 
00072     void retrieveMessage(const MsgHandler::MsgType type, const std::string& msg);
00073 
00074     const std::string& getFileName() const;
00075 
00076 protected:
00077     virtual bool initOptions();
00078 
00079 
00085     void submitEndAndCleanup(GUINet* net, SUMOTime simStartTime, SUMOTime simEndTime);
00086 
00087 protected:
00089     MFXInterThreadEventClient* myParent;
00090 
00092     std::string myFile;
00093 
00096     OutputDevice* myErrorRetriever, *myMessageRetriever, *myWarningRetriever;
00097 
00098     MFXEventQue& myEventQue;
00099 
00100     FXEX::FXThreadEvent& myEventThrow;
00101 
00103     bool myLoadNet;
00104 
00105 };
00106 
00107 
00108 #endif
00109 
00110 /****************************************************************************/
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines