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
FXint submitEndAndCleanup (GNEEvent_FileLoaded::Type type, 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 41 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 583 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 626 of file GNELoadThread.cpp.

◆ newNetwork()

void GNELoadThread::newNetwork ( )

begins the creation of an empty network

Definition at line 612 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 633 of file GNELoadThread.cpp.

References myEventQueue, and myEventThrow.

Referenced by GNELoadThread().

Here is the caller graph for this function:

◆ run()

FXint GNELoadThread::run ( )
virtual

starts the thread. The thread ends after the net has been loaded

Reimplemented from MFXSingleEventThread.

Definition at line 66 of file GNELoadThread.cpp.

References NBEdgeCont::addPrefix(), NBNodeCont::addPrefix(), GNENetHelper::AttributeCarriers::addPrefixToEdges(), GNENetHelper::AttributeCarriers::addPrefixToJunctions(), MsgHandler::addRetriever(), NBNetBuilder::applyOptions(), NBFrame::checkOptions(), NIFrame::checkOptions(), NWFrame::checkOptions(), SystemFrame::checkOptions(), MsgHandler::clear(), NBNetBuilder::compute(), GNENet::computeAndUpdate(), GeoConvHelper::computeFinal(), GNEEvent_FileLoaded::CONSOLE, MsgHandler::enableDebugGLMessages(), MsgHandler::enableDebugMessages(), StringUtils::endsWith(), GNENet::getAttributeCarriers(), NBNetBuilder::getEdgeCont(), MsgHandler::getErrorInstance(), MsgHandler::getMessageInstance(), GNENet::getNetBuilder(), NBNetBuilder::getNodeCont(), OptionsCont::getOptions(), MsgHandler::getWarningInstance(), GeoConvHelper::init(), MsgHandler::initOutputOptions(), RandHelper::initRandGlobal(), GNEEvent_FileLoaded::INVALID_CONFIG, GNEEvent_FileLoaded::INVALID_OPTIONS, GNEEvent_FileLoaded::INVALID_PROJECTION, GNEEvent_FileLoaded::INVALID_TYPE, NILoader::load(), loadConsoleOptions(), GNEApplicationWindowHelper::GNENetconvertConfigHandler::loadNetconvertConfig(), GNEApplicationWindowHelper::GNENeteditConfigHandler::loadNeteditConfig(), GNEApplicationWindowHelper::GNESumoConfigHandler::loadSumoConfig(), myApplicationWindow, myErrorRetriever, myMessageRetriever, myWarningRetriever, GNEEvent_FileLoaded::NETCCFG, GNEEvent_FileLoaded::NETECFG, FileBucket::NETWORK, GNEEvent_FileLoaded::NETWORK, GNEEvent_FileLoaded::NEW, GNEEvent_FileLoaded::OSM, XMLSubSys::setValidation(), submitEndAndCleanup(), GNEEvent_FileLoaded::SUMOCFG, TL, WRITE_ERROR, and WRITE_MESSAGE.

◆ setDefaultOptions()

void GNELoadThread::setDefaultOptions ( OptionsCont & neteditOptions)
static

sets required options for proper functioning

Definition at line 575 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()

FXint GNELoadThread::submitEndAndCleanup ( GNEEvent_FileLoaded::Type type,
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 264 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 82 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 85 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 85 of file GNELoadThread.h.

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

◆ myEventQueue

MFXSynchQue<GUIEvent*>& GNELoadThread::myEventQueue
private

event Queue

Definition at line 88 of file GNELoadThread.h.

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

◆ myEventThrow

FXEX::MFXThreadEvent& GNELoadThread::myEventThrow
private

event throw

Definition at line 91 of file GNELoadThread.h.

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

◆ myGLDebugRetriever

OutputDevice * GNELoadThread::myGLDebugRetriever
private

Definition at line 85 of file GNELoadThread.h.

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

◆ myMessageRetriever

OutputDevice * GNELoadThread::myMessageRetriever
private

Definition at line 85 of file GNELoadThread.h.

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

◆ myWarningRetriever

OutputDevice * GNELoadThread::myWarningRetriever
private

Definition at line 85 of file GNELoadThread.h.

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


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