Eclipse SUMO - Simulation of Urban MObility
GNELoadThread Class Reference

#include <GNELoadThread.h>

Inheritance diagram for GNELoadThread:
[legend]
Collaboration diagram for GNELoadThread:
[legend]

Public Member Functions

 GNELoadThread (GNEApplicationWindow *applicationWindow, MFXSynchQue< GUIEvent * > &eq, FXEX::MFXThreadEvent &ev)
 constructor More...
 
void loadNetworkOrConfig ()
 begins the loading of an existent network or config More...
 
void newNetwork ()
 begins the creation of an empty network More...
 
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...
 
virtual ~GNELoadThread ()
 destructor More...
 

Static Public Member Functions

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

Protected Types

enum  { ID_THREAD_EVENT }
 FOX declaration. More...
 

Protected Member Functions

long onThreadEvent (FXObject *, FXSelector, void *)
 
long onThreadSignal (FXObject *, FXSelector, void *)
 
void signal ()
 
void signal (FXuint seltype)
 

Static Protected Member Functions

static void sleep (long ms)
 

Protected Attributes

FXApp * myApp = nullptr
 pointer to APP More...
 
MFXInterThreadEventClientmyClient = nullptr
 thread client More...
 

Private Member Functions

bool loadConsoleOptions ()
 load options through console More...
 
void submitEndAndCleanup (GNENet *net, const std::string &loadedFile, const std::string &guiSettingsFile="", const bool viewportFromRegistry=false)
 Closes the loading process. More...
 

Private Attributes

FXEX::MFXThreadEventHandle event
 event More...
 
GNEApplicationWindowmyApplicationWindow
 netedit application windows More...
 
OutputDevicemyDebugRetriever
 
OutputDevicemyErrorRetriever
 The instances of message retriever encapsulations Needed to be deleted from the handler later on. More...
 
MFXSynchQue< GUIEvent * > & myEventQueue
 event Queue More...
 
FXEX::MFXThreadEventmyEventThrow
 event throw More...
 
OutputDevicemyGLDebugRetriever
 
OutputDevicemyMessageRetriever
 
OutputDevicemyWarningRetriever
 

Detailed Description

Definition at line 43 of file GNELoadThread.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited

FOX declaration.

Enumerator
ID_THREAD_EVENT 

Definition at line 37 of file MFXSingleEventThread.h.

Constructor & Destructor Documentation

◆ GNELoadThread()

◆ ~GNELoadThread()

GNELoadThread::~GNELoadThread ( )
virtual

Member Function Documentation

◆ fillOptions()

◆ loadConsoleOptions()

bool GNELoadThread::loadConsoleOptions ( )
private

load options through console

Definition at line 523 of file GNELoadThread.cpp.

References GNEApplicationWindow::consoleOptionsLoaded(), fillOptions(), OptionsCont::getOptions(), OptionsIO::getOptions(), myApplicationWindow, OptionsCont::resetWritable(), setDefaultOptions(), TL, and WRITE_ERROR.

Referenced by run().

Here is the caller graph for this function:

◆ loadNetworkOrConfig()

void GNELoadThread::loadNetworkOrConfig ( )

◆ newNetwork()

void GNELoadThread::newNetwork ( )

begins the creation of an empty network

Definition at line 552 of file GNELoadThread.cpp.

References fillOptions(), OptionsCont::getOptions(), and setDefaultOptions().

Referenced by GNEApplicationWindow::createNewNetwork().

Here is the caller graph for this function:

◆ onThreadEvent()

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

Definition at line 128 of file MFXSingleEventThread.cpp.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onThreadSignal()

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

Definition at line 113 of file MFXSingleEventThread.cpp.

References PIPE_READ, FXEX::SEL_THREAD, and UNUSED_PARAMETER.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ retrieveMessage()

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

Retrieves messages from the loading module.

Definition at line 573 of file GNELoadThread.cpp.

References myEventQueue, myEventThrow, MFXSynchQue< T, Container >::push_back(), and FXEX::MFXThreadEvent::signal().

Referenced by GNELoadThread().

Here is the caller graph for this function:

◆ run()

FXint GNELoadThread::run ( )
virtual

◆ setDefaultOptions()

◆ signal() [1/2]

void MFXSingleEventThread::signal ( )
inherited

Definition at line 89 of file MFXSingleEventThread.cpp.

References PIPE_WRITE, FXEX::SEL_THREAD, and UNUSED_PARAMETER.

◆ signal() [2/2]

void MFXSingleEventThread::signal ( FXuint  seltype)
inherited

Definition at line 101 of file MFXSingleEventThread.cpp.

References PIPE_WRITE, and UNUSED_PARAMETER.

◆ sleep()

void MFXSingleEventThread::sleep ( long  ms)
staticinherited

Definition at line 142 of file MFXSingleEventThread.cpp.

Referenced by GUIRunThread::deleteSim(), GUIApplicationWindow::loadOnStartup(), GUISUMOAbstractView::makeSnapshot(), and GUIRunThread::tryStep().

Here is the caller graph for this function:

◆ submitEndAndCleanup()

void GNELoadThread::submitEndAndCleanup ( GNENet net,
const std::string &  loadedFile,
const std::string &  guiSettingsFile = "",
const bool  viewportFromRegistry = false 
)
private

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

References MsgHandler::getDebugInstance(), MsgHandler::getErrorInstance(), MsgHandler::getGLDebugInstance(), MsgHandler::getMessageInstance(), MsgHandler::getWarningInstance(), myDebugRetriever, myErrorRetriever, myEventQueue, myEventThrow, myGLDebugRetriever, myMessageRetriever, myWarningRetriever, MFXSynchQue< T, Container >::push_back(), MsgHandler::removeRetriever(), and FXEX::MFXThreadEvent::signal().

Referenced by run().

Here is the caller graph for this function:

Field Documentation

◆ event

FXEX::MFXThreadEventHandle MFXSingleEventThread::event
privateinherited

event

Definition at line 72 of file MFXSingleEventThread.h.

◆ myApp

FXApp* MFXSingleEventThread::myApp = nullptr
protectedinherited

pointer to APP

Definition at line 65 of file MFXSingleEventThread.h.

Referenced by GUIRunThread::run().

◆ myApplicationWindow

GNEApplicationWindow* GNELoadThread::myApplicationWindow
private

netedit application windows

Definition at line 83 of file GNELoadThread.h.

Referenced by loadConsoleOptions(), and run().

◆ myClient

MFXInterThreadEventClient* MFXSingleEventThread::myClient = nullptr
protectedinherited

thread client

Definition at line 68 of file MFXSingleEventThread.h.

◆ myDebugRetriever

OutputDevice * GNELoadThread::myDebugRetriever
private

Definition at line 86 of file GNELoadThread.h.

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

◆ myErrorRetriever

OutputDevice* GNELoadThread::myErrorRetriever
private

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

Definition at line 86 of file GNELoadThread.h.

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

◆ myEventQueue

MFXSynchQue<GUIEvent*>& GNELoadThread::myEventQueue
private

event Queue

Definition at line 89 of file GNELoadThread.h.

Referenced by retrieveMessage(), and submitEndAndCleanup().

◆ myEventThrow

FXEX::MFXThreadEvent& GNELoadThread::myEventThrow
private

event throw

Definition at line 92 of file GNELoadThread.h.

Referenced by retrieveMessage(), and submitEndAndCleanup().

◆ myGLDebugRetriever

OutputDevice * GNELoadThread::myGLDebugRetriever
private

Definition at line 86 of file GNELoadThread.h.

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

◆ myMessageRetriever

OutputDevice * GNELoadThread::myMessageRetriever
private

Definition at line 86 of file GNELoadThread.h.

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

◆ myWarningRetriever

OutputDevice * GNELoadThread::myWarningRetriever
private

Definition at line 86 of file GNELoadThread.h.

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


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