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

References 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 ( )

begins the loading of an existent network or config

Definition at line 572 of file GNELoadThread.cpp.

◆ newNetwork()

void GNELoadThread::newNetwork ( )

begins the creation of an empty network

Definition at line 558 of file GNELoadThread.cpp.

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

◆ onThreadEvent()

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

Definition at line 128 of file MFXSingleEventThread.cpp.

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

References myEventQueue, and myEventThrow.

Referenced by GNELoadThread().

Here is the caller graph for this function:

◆ run()

◆ setDefaultOptions()

void GNELoadThread::setDefaultOptions ( OptionsCont & neteditOptions)
static

sets required options for proper functioning

Definition at line 521 of file GNELoadThread.cpp.

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

Referenced by GNEApplicationWindow::createNewNetwork(), GNEApplicationWindow::GNEApplicationWindow(), loadConsoleOptions(), main(), and newNetwork().

Here is the caller graph for this function:

◆ signal() [1/2]

void MFXSingleEventThread::signal ( )
inherited

Definition at line 89 of file MFXSingleEventThread.cpp.

References event, 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 event, PIPE_WRITE, and UNUSED_PARAMETER.

◆ sleep()

void MFXSingleEventThread::sleep ( long ms)
staticinherited

Definition at line 142 of file MFXSingleEventThread.cpp.

Referenced by GUIRunThread::deleteSim(), 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 237 of file GNELoadThread.cpp.

References MsgHandler::getErrorInstance(), MsgHandler::getMessageInstance(), MsgHandler::getWarningInstance(), myErrorRetriever, myEventQueue, myEventThrow, myMessageRetriever, myWarningRetriever, and MsgHandler::removeRetriever().

Referenced by run().

Here is the caller graph for this function:

Field Documentation

◆ event

FXEX::MFXThreadEventHandle MFXSingleEventThread::event
privateinherited

◆ myApp

FXApp* MFXSingleEventThread::myApp = nullptr
protectedinherited

pointer to APP

Definition at line 65 of file MFXSingleEventThread.h.

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

◆ myApplicationWindow

GNEApplicationWindow* GNELoadThread::myApplicationWindow
private

netedit application windows

Definition at line 83 of file GNELoadThread.h.

Referenced by GNELoadThread(), loadConsoleOptions(), and run().

◆ myClient

MFXInterThreadEventClient* MFXSingleEventThread::myClient = nullptr
protectedinherited

thread client

Definition at line 68 of file MFXSingleEventThread.h.

Referenced by MFXSingleEventThread(), and onThreadEvent().

◆ myDebugRetriever

OutputDevice * GNELoadThread::myDebugRetriever
private

Definition at line 86 of file GNELoadThread.h.

Referenced by GNELoadThread(), 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 GNELoadThread(), retrieveMessage(), and submitEndAndCleanup().

◆ myEventThrow

FXEX::MFXThreadEvent& GNELoadThread::myEventThrow
private

event throw

Definition at line 92 of file GNELoadThread.h.

Referenced by GNELoadThread(), retrieveMessage(), and submitEndAndCleanup().

◆ myGLDebugRetriever

OutputDevice * GNELoadThread::myGLDebugRetriever
private

Definition at line 86 of file GNELoadThread.h.

Referenced by GNELoadThread(), 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: