SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
GUILoadThread Class Reference

#include <GUILoadThread.h>

Inheritance diagram for GUILoadThread:
FXSingleEventThread FXObject FXThread

Public Types

enum  { ID_THREAD_EVENT }
 

Public Member Functions

const std::string & getFileName () const
 
 GUILoadThread (FXApp *app, MFXInterThreadEventClient *mw, MFXEventQue< GUIEvent * > &eq, FXEX::FXThreadEvent &ev)
 constructor More...
 
void loadConfigOrNet (const std::string &file, bool isNet)
 begins the loading of the given file More...
 
long onThreadEvent (FXObject *, FXSelector, void *)
 
long onThreadSignal (FXObject *, FXSelector, void *)
 
void reloadConfigOrNet ()
 reloads according to the given input options More...
 
void retrieveMessage (const MsgHandler::MsgType type, const std::string &msg)
 Retrieves messages from the loading module. More...
 
FXint run ()
 
void signal ()
 
void signal (FXuint seltype)
 
virtual ~GUILoadThread ()
 destructor More...
 

Static Public Member Functions

static void sleep (long ms)
 

Protected Member Functions

void submitEndAndCleanup (GUINet *net, const SUMOTime simStartTime, const SUMOTime simEndTime, const std::vector< std::string > &guiSettingsFiles=std::vector< std::string >(), const bool osgView=false)
 Closes the loading process. More...
 

Protected Attributes

OutputDevicemyErrorRetriever
 The instances of message retriever encapsulations Needed to be deleted from the handler later on. More...
 
MFXEventQue< GUIEvent * > & myEventQue
 
FXEX::FXThreadEventmyEventThrow
 
std::string myFile
 the path to load the simulation from More...
 
bool myLoadNet
 Information whether only the network shall be loaded. More...
 
OutputDevicemyMessageRetriever
 
MFXInterThreadEventClientmyParent
 the parent window to inform about the loading More...
 
std::string myTitle
 the title string for the application More...
 
OutputDevicemyWarningRetriever
 

Detailed Description

Definition at line 57 of file GUILoadThread.h.

Member Enumeration Documentation

anonymous enum
inherited
Enumerator
ID_THREAD_EVENT 

Definition at line 53 of file FXSingleEventThread.h.

Constructor & Destructor Documentation

GUILoadThread::~GUILoadThread ( )
virtual

destructor

Definition at line 94 of file GUILoadThread.cpp.

References myErrorRetriever, myMessageRetriever, and myWarningRetriever.

Member Function Documentation

const std::string & GUILoadThread::getFileName ( ) const

Definition at line 275 of file GUILoadThread.cpp.

References myFile.

void GUILoadThread::loadConfigOrNet ( const std::string &  file,
bool  isNet 
)

begins the loading of the given file

Definition at line 259 of file GUILoadThread.cpp.

References myFile, and myLoadNet.

Referenced by GUIApplicationWindow::loadConfigOrNet().

long FXSingleEventThread::onThreadEvent ( FXObject ,
FXSelector  ,
void *   
)
inherited

Definition at line 133 of file FXSingleEventThread.cpp.

long FXSingleEventThread::onThreadSignal ( FXObject ,
FXSelector  ,
void *   
)
inherited

Definition at line 119 of file FXSingleEventThread.cpp.

References PIPE_READ, and FXEX::SEL_THREAD.

void GUILoadThread::reloadConfigOrNet ( )

reloads according to the given input options

Definition at line 254 of file GUILoadThread.cpp.

Referenced by GUIApplicationWindow::loadConfigOrNet().

void GUILoadThread::retrieveMessage ( const MsgHandler::MsgType  type,
const std::string &  msg 
)

Retrieves messages from the loading module.

Definition at line 267 of file GUILoadThread.cpp.

References MFXEventQue< T >::add(), myEventQue, myEventThrow, and FXEX::FXThreadEvent::signal().

Referenced by GUILoadThread().

void FXSingleEventThread::signal ( )
inherited

Definition at line 97 of file FXSingleEventThread.cpp.

References PIPE_WRITE, and FXEX::SEL_THREAD.

void FXSingleEventThread::signal ( FXuint  seltype)
inherited

Definition at line 108 of file FXSingleEventThread.cpp.

References PIPE_WRITE, and UNUSED_PARAMETER.

void FXSingleEventThread::sleep ( long  ms)
staticinherited
void GUILoadThread::submitEndAndCleanup ( GUINet net,
const SUMOTime  simStartTime,
const SUMOTime  simEndTime,
const std::vector< std::string > &  guiSettingsFiles = std::vector<std::string>(),
const bool  osgView = false 
)
protected

Closes the loading process.

This method is called both on success and failure. All message callbacks to this instance are removed and the parent application is informed about the loading

Definition at line 237 of file GUILoadThread.cpp.

References MFXEventQue< T >::add(), MsgHandler::getErrorInstance(), MsgHandler::getMessageInstance(), MsgHandler::getWarningInstance(), myErrorRetriever, myEventQue, myEventThrow, myMessageRetriever, myTitle, myWarningRetriever, MsgHandler::removeRetriever(), and FXEX::FXThreadEvent::signal().

Referenced by run().

Field Documentation

OutputDevice* GUILoadThread::myErrorRetriever
protected

The instances of message retriever encapsulations Needed to be deleted from the handler later on.

Definition at line 103 of file GUILoadThread.h.

Referenced by GUILoadThread(), run(), submitEndAndCleanup(), and ~GUILoadThread().

MFXEventQue<GUIEvent*>& GUILoadThread::myEventQue
protected

Definition at line 105 of file GUILoadThread.h.

Referenced by retrieveMessage(), and submitEndAndCleanup().

FXEX::FXThreadEvent& GUILoadThread::myEventThrow
protected

Definition at line 107 of file GUILoadThread.h.

Referenced by retrieveMessage(), and submitEndAndCleanup().

std::string GUILoadThread::myFile
protected

the path to load the simulation from

Definition at line 96 of file GUILoadThread.h.

Referenced by getFileName(), loadConfigOrNet(), and run().

bool GUILoadThread::myLoadNet
protected

Information whether only the network shall be loaded.

Definition at line 110 of file GUILoadThread.h.

Referenced by loadConfigOrNet(), and run().

OutputDevice * GUILoadThread::myMessageRetriever
protected

Definition at line 103 of file GUILoadThread.h.

Referenced by GUILoadThread(), run(), submitEndAndCleanup(), and ~GUILoadThread().

MFXInterThreadEventClient* GUILoadThread::myParent
protected

the parent window to inform about the loading

Definition at line 93 of file GUILoadThread.h.

std::string GUILoadThread::myTitle
protected

the title string for the application

Definition at line 99 of file GUILoadThread.h.

Referenced by run(), and submitEndAndCleanup().

OutputDevice * GUILoadThread::myWarningRetriever
protected

Definition at line 103 of file GUILoadThread.h.

Referenced by GUILoadThread(), run(), submitEndAndCleanup(), and ~GUILoadThread().


The documentation for this class was generated from the following files: