Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
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
 
void loadNetworkOrConfig ()
 begins the loading of an existent network or config
 
void newNetwork ()
 begins the creation of an empty network
 
void retrieveMessage (const MsgHandler::MsgType type, const std::string &msg)
 Retrieves messages from the loading module.
 
FXint run ()
 starts the thread. The thread ends after the net has been loaded
 
virtual ~GNELoadThread ()
 destructor
 

Static Public Member Functions

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

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
 
MFXInterThreadEventClientmyClient = nullptr
 thread client
 

Private Member Functions

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

Private Attributes

FXEX::MFXThreadEventHandle event
 event
 
GNEApplicationWindowmyApplicationWindow
 netedit application windows
 
OutputDevicemyDebugRetriever
 
OutputDevicemyErrorRetriever
 The instances of message retriever encapsulations Needed to be deleted from the handler later on.
 
MFXSynchQue< GUIEvent * > & myEventQueue
 event Queue
 
FXEX::MFXThreadEventmyEventThrow
 event throw
 
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 526 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 555 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.

References MFXInterThreadEventClient::eventOccurred(), and MFXSingleEventThread::myClient.

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 MFXSingleEventThread::event, 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 576 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

◆ signal() [2/2]

void MFXSingleEventThread::signal ( FXuint  seltype)
inherited

◆ 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

◆ myApp

FXApp* MFXSingleEventThread::myApp = nullptr
protectedinherited

pointer to APP

Definition at line 65 of file MFXSingleEventThread.h.

Referenced by GUIRunThread::run(), and MFXSingleEventThread::~MFXSingleEventThread().

◆ 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.

Referenced by MFXSingleEventThread::onThreadEvent().

◆ 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: