SUMO - Simulation of Urban MObility
GNELoadThread Class Reference

#include <GNELoadThread.h>

Inheritance diagram for GNELoadThread:
Inheritance graph
Collaboration diagram for GNELoadThread:
Collaboration graph

Public Types

enum  { ID_THREAD_EVENT }
 

Public Member Functions

 GNELoadThread (FXApp *app, MFXInterThreadEventClient *mw, MFXEventQue< GUIEvent * > &eq, FXEX::FXThreadEvent &ev)
 constructor More...
 
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 More...
 
long onThreadEvent (FXObject *, FXSelector, void *)
 
long onThreadSignal (FXObject *, FXSelector, void *)
 
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 ~GNELoadThread ()
 destructor More...
 

Static Public Member Functions

static void fillOptions (OptionsCont &oc)
 clears and initializes the OptionsCont More...
 
static void setDefaultOptions (OptionsCont &oc)
 sets required options for proper functioning More...
 
static void sleep (long ms)
 

Protected Member Functions

bool initOptions ()
 
void submitEndAndCleanup (GNENet *net, const std::string &guiSettingsFile="", const bool viewportFromRegistry=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
 
bool myNewNet
 if true, a new net is created More...
 
bool myOptionsReady
 if true, options will not be read from myFile More...
 
MFXInterThreadEventClientmyParent
 the parent window to inform about the loading More...
 
OutputDevicemyWarningRetriever
 

Detailed Description

Definition at line 55 of file GNELoadThread.h.

Member Enumeration Documentation

anonymous enum
inherited
Enumerator
ID_THREAD_EVENT 

Definition at line 53 of file FXSingleEventThread.h.

Constructor & Destructor Documentation

GNELoadThread::~GNELoadThread ( )
virtual

destructor

Definition at line 78 of file GNELoadThread.cpp.

References myErrorRetriever, myMessageRetriever, and myWarningRetriever.

Member Function Documentation

void GNELoadThread::loadConfigOrNet ( const std::string &  file,
bool  isNet,
bool  optionsReady = false,
bool  newNet = false 
)

begins the loading of a netconvert configuration or a a network

Parameters
[in]fileThe network or configuration-file to be loaded
[in]isNetwhether file is a network file
[in]optionsReadywhether options are already initialized

Definition at line 265 of file GNELoadThread.cpp.

References myFile, myLoadNet, myNewNet, and myOptionsReady.

Referenced by GNEApplicationWindow::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 GNELoadThread::retrieveMessage ( const MsgHandler::MsgType  type,
const std::string &  msg 
)

Retrieves messages from the loading module.

Definition at line 275 of file GNELoadThread.cpp.

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

Referenced by GNELoadThread().

void GNELoadThread::setDefaultOptions ( OptionsCont oc)
static

sets required options for proper functioning

Definition at line 231 of file GNELoadThread.cpp.

References OptionsCont::set().

Referenced by initOptions(), and GNEApplicationWindow::onCmdNewNetwork().

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 GNELoadThread::submitEndAndCleanup ( GNENet net,
const std::string &  guiSettingsFile = "",
const bool  viewportFromRegistry = 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 184 of file GNELoadThread.cpp.

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

Referenced by run().

Field Documentation

OutputDevice* GNELoadThread::myErrorRetriever
protected

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

Definition at line 104 of file GNELoadThread.h.

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

MFXEventQue<GUIEvent*>& GNELoadThread::myEventQue
protected

Definition at line 106 of file GNELoadThread.h.

Referenced by retrieveMessage(), and submitEndAndCleanup().

FXEX::FXThreadEvent& GNELoadThread::myEventThrow
protected

Definition at line 108 of file GNELoadThread.h.

Referenced by retrieveMessage(), and submitEndAndCleanup().

std::string GNELoadThread::myFile
protected

the path to load the simulation from

Definition at line 100 of file GNELoadThread.h.

Referenced by initOptions(), loadConfigOrNet(), and submitEndAndCleanup().

bool GNELoadThread::myLoadNet
protected

Information whether only the network shall be loaded.

Definition at line 111 of file GNELoadThread.h.

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

OutputDevice * GNELoadThread::myMessageRetriever
protected

Definition at line 104 of file GNELoadThread.h.

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

bool GNELoadThread::myNewNet
protected

if true, a new net is created

Definition at line 117 of file GNELoadThread.h.

Referenced by loadConfigOrNet(), and run().

bool GNELoadThread::myOptionsReady
protected

if true, options will not be read from myFile

Definition at line 114 of file GNELoadThread.h.

Referenced by loadConfigOrNet(), and run().

MFXInterThreadEventClient* GNELoadThread::myParent
protected

the parent window to inform about the loading

Definition at line 97 of file GNELoadThread.h.

OutputDevice * GNELoadThread::myWarningRetriever
protected

Definition at line 104 of file GNELoadThread.h.

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


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