Eclipse SUMO - Simulation of Urban MObility
GNELoadThread Class Reference

#include <GNELoadThread.h>

Inheritance diagram for GNELoadThread:
Collaboration diagram for GNELoadThread:

Public Types

enum  { ID_THREAD_EVENT }
 

Public Member Functions

 GNELoadThread (FXApp *app, MFXInterThreadEventClient *mw, FXSynchQue< GUIEvent * > &eq, FXEX::FXThreadEvent &ev)
 constructor More...
 
void loadConfigOrNet (const std::string &file, bool isNet, bool useStartupOptions, 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 ()
 starts the thread. The thread ends after the net has been loaded More...
 
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 ()
 init options More...
 
void submitEndAndCleanup (GNENet *net, const std::string &guiSettingsFile="", const bool viewportFromRegistry=false)
 Closes the loading process. More...
 

Protected Attributes

OutputDevicemyDebugRetriever
 
OutputDevicemyErrorRetriever
 The instances of message retriever encapsulations Needed to be deleted from the handler later on. More...
 
FXSynchQue< GUIEvent * > & myEventQue
 event Queue More...
 
FXEX::FXThreadEventmyEventThrow
 event throw More...
 
std::string myFile
 the path to load the network from More...
 
OutputDevicemyGLDebugRetriever
 
bool myLoadNet
 Information whether only the network shall be loaded. More...
 
OutputDevicemyMessageRetriever
 
bool myNewNet
 if true, a new net is created More...
 
MFXInterThreadEventClientmyParent
 the parent window to inform about the loading More...
 
OutputDevicemyWarningRetriever
 

Private Attributes

FXEX::FXThreadEventHandle event
 
FXApp * myApp
 
MFXInterThreadEventClientmyClient
 

Detailed Description

Definition at line 46 of file GNELoadThread.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited
Enumerator
ID_THREAD_EVENT 

Definition at line 46 of file FXSingleEventThread.h.

Constructor & Destructor Documentation

◆ GNELoadThread()

◆ ~GNELoadThread()

GNELoadThread::~GNELoadThread ( )
virtual

Member Function Documentation

◆ fillOptions()

◆ initOptions()

◆ loadConfigOrNet()

void GNELoadThread::loadConfigOrNet ( const std::string &  file,
bool  isNet,
bool  useStartupOptions,
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]useStartupOptionswhether the initial startup options shall be used

Definition at line 333 of file GNELoadThread.cpp.

References myFile, myLoadNet, myNewNet, and OptionsIO::setArgs().

Referenced by GNEApplicationWindow::loadConfigOrNet().

◆ onThreadEvent()

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

Definition at line 125 of file FXSingleEventThread.cpp.

◆ onThreadSignal()

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

Definition at line 110 of file FXSingleEventThread.cpp.

References PIPE_READ, FXEX::SEL_THREAD, and UNUSED_PARAMETER.

◆ retrieveMessage()

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

Retrieves messages from the loading module.

Definition at line 345 of file GNELoadThread.cpp.

References myEventQue, myEventThrow, FXSynchQue< T, Container >::push_back(), and FXEX::FXThreadEvent::signal().

Referenced by GNELoadThread().

◆ run()

◆ setDefaultOptions()

void GNELoadThread::setDefaultOptions ( OptionsCont oc)
static

sets required options for proper functioning

Definition at line 290 of file GNELoadThread.cpp.

References OptionsCont::resetWritable(), and OptionsCont::set().

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

◆ signal() [1/2]

void FXSingleEventThread::signal ( )
inherited

Definition at line 86 of file FXSingleEventThread.cpp.

References PIPE_WRITE, FXEX::SEL_THREAD, and UNUSED_PARAMETER.

◆ signal() [2/2]

void FXSingleEventThread::signal ( FXuint  seltype)
inherited

Definition at line 98 of file FXSingleEventThread.cpp.

References PIPE_WRITE, and UNUSED_PARAMETER.

◆ sleep()

void FXSingleEventThread::sleep ( long  ms)
staticinherited

◆ submitEndAndCleanup()

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 183 of file GNELoadThread.cpp.

References MsgHandler::getDebugInstance(), MsgHandler::getErrorInstance(), MsgHandler::getGLDebugInstance(), MsgHandler::getMessageInstance(), MsgHandler::getWarningInstance(), myDebugRetriever, myErrorRetriever, myEventQue, myEventThrow, myFile, myGLDebugRetriever, myMessageRetriever, myWarningRetriever, FXSynchQue< T, Container >::push_back(), MsgHandler::removeRetriever(), and FXEX::FXThreadEvent::signal().

Referenced by run().

Field Documentation

◆ event

FXEX::FXThreadEventHandle FXSingleEventThread::event
privateinherited

Definition at line 39 of file FXSingleEventThread.h.

◆ myApp

FXApp* FXSingleEventThread::myApp
privateinherited

Definition at line 70 of file FXSingleEventThread.h.

◆ myClient

MFXInterThreadEventClient* FXSingleEventThread::myClient
privateinherited

Definition at line 71 of file FXSingleEventThread.h.

◆ myDebugRetriever

OutputDevice * GNELoadThread::myDebugRetriever
protected

Definition at line 93 of file GNELoadThread.h.

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

◆ myErrorRetriever

OutputDevice* GNELoadThread::myErrorRetriever
protected

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

Definition at line 93 of file GNELoadThread.h.

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

◆ myEventQue

FXSynchQue<GUIEvent*>& GNELoadThread::myEventQue
protected

event Queue

Definition at line 96 of file GNELoadThread.h.

Referenced by retrieveMessage(), and submitEndAndCleanup().

◆ myEventThrow

FXEX::FXThreadEvent& GNELoadThread::myEventThrow
protected

event throw

Definition at line 99 of file GNELoadThread.h.

Referenced by retrieveMessage(), and submitEndAndCleanup().

◆ myFile

std::string GNELoadThread::myFile
protected

the path to load the network from

Definition at line 90 of file GNELoadThread.h.

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

◆ myGLDebugRetriever

OutputDevice * GNELoadThread::myGLDebugRetriever
protected

Definition at line 93 of file GNELoadThread.h.

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

◆ myLoadNet

bool GNELoadThread::myLoadNet
protected

Information whether only the network shall be loaded.

Definition at line 102 of file GNELoadThread.h.

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

◆ myMessageRetriever

OutputDevice * GNELoadThread::myMessageRetriever
protected

Definition at line 93 of file GNELoadThread.h.

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

◆ myNewNet

bool GNELoadThread::myNewNet
protected

if true, a new net is created

Definition at line 105 of file GNELoadThread.h.

Referenced by loadConfigOrNet(), and run().

◆ myParent

MFXInterThreadEventClient* GNELoadThread::myParent
protected

the parent window to inform about the loading

Definition at line 87 of file GNELoadThread.h.

◆ myWarningRetriever

OutputDevice * GNELoadThread::myWarningRetriever
protected

Definition at line 93 of file GNELoadThread.h.

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


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