|
SUMO - Simulation of Urban MObility
|
#include <FXThreadEvent.h>
Public Types | |
| enum | { ID_NONE = 0, ID_DELETE = 6, ID_DISABLE, ID_ENABLE, ID_SETVALUE = 17, ID_SETINTVALUE, ID_SETREALVALUE, ID_SETSTRINGVALUE, ID_SETINTRANGE, ID_SETREALRANGE, ID_GETINTVALUE, ID_GETREALVALUE, ID_GETSTRINGVALUE, ID_XML, ID_META, ID_COMMENT, ID_DOCUMENT, ID_TAG, ID_CONTENT, ID_LAST } |
| enum | { ID_THREAD_EVENT = FXBaseObject::ID_LAST, ID_LAST } |
Public Member Functions | |
| virtual void | create () |
| create resource | |
| virtual void | destroy () |
| destroy resource | |
| virtual void | detach () |
| detach resource | |
| virtual void | disable () |
| disable us | |
| virtual void | enable () |
| enable us | |
| FXThreadEvent (FXObject *tgt=NULL, FXSelector sel=0) | |
| Construct an object capable of signaling the main FOX event loop. | |
| FXApp * | getApp () |
| application pointer | |
| FXSelector | getSelector () |
| get the message | |
| FXObject * | getTarget () |
| get the target | |
| void * | getUserData () |
| get user data | |
| FXuint | getUserDataLen () |
| get user daat length | |
| FXbool | isEnabled () |
| are we enabled? | |
| virtual FXbool | isReadonly () |
| are we modifiable | |
| virtual void | load (FXStream &store) |
| load object from stream | |
| long | onCmdDisable (FXObject *, FXSelector, void *) |
| long | onCmdEnable (FXObject *, FXSelector, void *) |
| long | onThreadEvent (FXObject *, FXSelector, void *) |
| long | onThreadSignal (FXObject *, FXSelector, void *) |
| long | onUpdate (FXObject *, FXSelector, void *) |
| virtual void | save (FXStream &store) const |
| save object to stream | |
| virtual void | setReadonly (FXbool mode=TRUE) |
| set modifiable mode | |
| void | setSelector (FXSelector sel) |
| set the selector | |
| void | setTarget (FXObject *tgt) |
| set the target | |
| void | setUserData (void *d) |
| set user data | |
| void | setUserDataLen (FXuint len) |
| set the user data length | |
| void | signal (FXuint seltype) |
| void | signal () |
| virtual | ~FXThreadEvent () |
| destructor | |
Protected Types | |
| enum | { FLAG_ENABLED = 0x00000002, FLAG_UPDATE = 0x00000004, FLAG_FOCUSED = 0x00000010, FLAG_DIRTY = 0x00000020, FLAG_RECALC = 0x00000040, FLAG_DEFAULT = 0x00000200, FLAG_INITIAL = 0x00000400, FLAG_ACTIVE = 0x00001000, FLAG_CHANGED = 0x00010000, FLAG_READONLY = 0x10000000 } |
flags defined are the same as those defined in FXWindow, etc. More... | |
Protected Member Functions | |
| FXThreadEvent (const FXThreadEvent &) | |
| FXThreadEvent & | operator= (const FXThreadEvent &) |
Protected Attributes | |
| void * | data |
| FXuint | datalen |
| FXuint | flags |
| FXSelector | message |
| FXuint | options |
| FXObject * | target |
Private Attributes | |
| FXThreadEventHandle | event |
:Description
Interthread communication object
------------------------------------------------------------------
Usage:
GUI_thread.h: ============
class MyGUI::FXWhatEver { // constructor MyGUI(...);
// message IDs enum { ID_THREAD_EVENT = FXWhatEver::ID_LAST, ID_LAST };
// message handler long onThreadEvent(FXObject*, FXSelector, void*);
// thread event object FXThreadEvent m_threadEvent; };
GUI_thread.cpp: ==============
// message map FXDEFMAP(MyGUI, FXWhatEver) = { FXMAPFUNC(SEL_THREAD_EVENT, MyGUI::ID_THREAD_EVENT, MyGUI::onThreadEvent) };
// constructor MyGUI::MyGUI(...) { m_threadEvent.setTarget(this), m_threadEvent.setSelector(ID_THREAD_EVENT); }
// message handler long onThreadEvent(FXObject*, FXSelector, void*) { do something with the GUI }
Worker_thread.cpp: =================
int threadFunction(...) { FXThreadEvent* pThreadEvent = (FXThreadEvent*)(ptr);
while (not_finished) { // work hard ...
// wake up GUI if (something_happened_and_the_GUI_needs_to_know_it) { pThreadEvent.signal(); } }
... }
Definition at line 111 of file FXThreadEvent.h.
anonymous enum [protected, inherited] |
flags defined are the same as those defined in FXWindow, etc.
| FLAG_ENABLED | |
| FLAG_UPDATE | |
| FLAG_FOCUSED | |
| FLAG_DIRTY | |
| FLAG_RECALC | |
| FLAG_DEFAULT | |
| FLAG_INITIAL | |
| FLAG_ACTIVE | |
| FLAG_CHANGED | |
| FLAG_READONLY |
Definition at line 67 of file FXBaseObject.h.
anonymous enum [inherited] |
Definition at line 92 of file FXBaseObject.h.
| anonymous enum |
Definition at line 122 of file FXThreadEvent.h.
| FXEX::FXThreadEvent::FXThreadEvent | ( | const FXThreadEvent & | ) | [protected] |
| FXEX::FXThreadEvent::FXThreadEvent | ( | FXObject * | tgt = NULL, |
| FXSelector | sel = 0 |
||
| ) |
Construct an object capable of signaling the main FOX event loop.
Definition at line 77 of file FXThreadEvent.cpp.
References ID_THREAD_EVENT, and PIPE_READ.
| FXEX::FXThreadEvent::~FXThreadEvent | ( | ) | [virtual] |
| virtual void FXEX::FXBaseObject::create | ( | ) | [inline, virtual, inherited] |
create resource
Definition at line 194 of file FXBaseObject.h.
| virtual void FXEX::FXBaseObject::destroy | ( | ) | [inline, virtual, inherited] |
destroy resource
Definition at line 200 of file FXBaseObject.h.
| virtual void FXEX::FXBaseObject::detach | ( | ) | [inline, virtual, inherited] |
detach resource
Definition at line 197 of file FXBaseObject.h.
| virtual void FXEX::FXBaseObject::disable | ( | ) | [inline, virtual, inherited] |
disable us
Definition at line 181 of file FXBaseObject.h.
Referenced by FXEX::FXBaseObject::onCmdDisable().
| virtual void FXEX::FXBaseObject::enable | ( | ) | [inline, virtual, inherited] |
enable us
Definition at line 176 of file FXBaseObject.h.
Referenced by FXEX::FXBaseObject::onCmdEnable().
| FXApp * FXEX::FXBaseObject::getApp | ( | ) | [inherited] |
application pointer
Definition at line 124 of file FXBaseObject.cpp.
References FXEX::FXBaseObject::app.
| FXSelector FXEX::FXBaseObject::getSelector | ( | ) | [inline, inherited] |
get the message
Definition at line 141 of file FXBaseObject.h.
| FXObject* FXEX::FXBaseObject::getTarget | ( | ) | [inline, inherited] |
get the target
Definition at line 131 of file FXBaseObject.h.
| void* FXEX::FXBaseObject::getUserData | ( | ) | [inline, inherited] |
get user data
Definition at line 151 of file FXBaseObject.h.
| FXuint FXEX::FXBaseObject::getUserDataLen | ( | ) | [inline, inherited] |
get user daat length
Definition at line 161 of file FXBaseObject.h.
| FXbool FXEX::FXBaseObject::isEnabled | ( | ) | [inline, inherited] |
are we enabled?
Definition at line 171 of file FXBaseObject.h.
| virtual FXbool FXEX::FXBaseObject::isReadonly | ( | ) | [inline, virtual, inherited] |
are we modifiable
Definition at line 186 of file FXBaseObject.h.
| void FXEX::FXBaseObject::load | ( | FXStream & | store | ) | [virtual, inherited] |
load object from stream
Definition at line 112 of file FXBaseObject.cpp.
References FXEX::FXBaseObject::app, FXEX::FXBaseObject::data, FXEX::FXBaseObject::datalen, FXEX::FXBaseObject::flags, FXEX::FXBaseObject::message, FXEX::FXBaseObject::options, and FXEX::FXBaseObject::target.
Definition at line 147 of file FXBaseObject.cpp.
References FXEX::FXBaseObject::disable().
Definition at line 141 of file FXBaseObject.cpp.
References FXEX::FXBaseObject::enable().
Definition at line 141 of file FXThreadEvent.cpp.
Definition at line 128 of file FXThreadEvent.cpp.
References PIPE_READ.
Definition at line 153 of file FXBaseObject.cpp.
References FXEX::FXBaseObject::FLAG_ENABLED, and FXEX::FXBaseObject::flags.
| FXThreadEvent& FXEX::FXThreadEvent::operator= | ( | const FXThreadEvent & | ) | [protected] |
| void FXEX::FXBaseObject::save | ( | FXStream & | store | ) | const [virtual, inherited] |
save object to stream
Definition at line 100 of file FXBaseObject.cpp.
References FXEX::FXBaseObject::app, FXEX::FXBaseObject::data, FXEX::FXBaseObject::datalen, FXEX::FXBaseObject::flags, FXEX::FXBaseObject::message, FXEX::FXBaseObject::options, and FXEX::FXBaseObject::target.
| void FXEX::FXBaseObject::setReadonly | ( | FXbool | mode = TRUE | ) | [virtual, inherited] |
set modifiable mode
Definition at line 132 of file FXBaseObject.cpp.
References FXEX::FXBaseObject::FLAG_READONLY, and FXEX::FXBaseObject::flags.
| void FXEX::FXBaseObject::setSelector | ( | FXSelector | sel | ) | [inline, inherited] |
set the selector
Definition at line 146 of file FXBaseObject.h.
Referenced by GUIApplicationWindow::dependentBuild().
| void FXEX::FXBaseObject::setTarget | ( | FXObject * | tgt | ) | [inline, inherited] |
set the target
Definition at line 136 of file FXBaseObject.h.
Referenced by GUIApplicationWindow::dependentBuild().
| void FXEX::FXBaseObject::setUserData | ( | void * | d | ) | [inline, inherited] |
set user data
Definition at line 156 of file FXBaseObject.h.
| void FXEX::FXBaseObject::setUserDataLen | ( | FXuint | len | ) | [inline, inherited] |
set the user data length
Definition at line 166 of file FXBaseObject.h.
| void FXEX::FXThreadEvent::signal | ( | ) |
Signal the event - using the SEL_THREAD FXSelector type
This is meant to be called from the worker thread - it sends a mesage to the target, which is in another thread.
Definition at line 105 of file FXThreadEvent.cpp.
References PIPE_WRITE.
Referenced by GUIRunThread::makeStep(), GUIRunThread::retrieveMessage(), GUILoadThread::retrieveMessage(), and GUILoadThread::submitEndAndCleanup().
| void FXEX::FXThreadEvent::signal | ( | FXuint | seltype | ) |
Signal the event - using the specified FXSelector
This is meant to be called from the worker thread - it sends a mesage to the target, which is in another thread.
Definition at line 116 of file FXThreadEvent.cpp.
References PIPE_WRITE, and UNUSED_PARAMETER.
void* FXEX::FXBaseObject::data [protected, inherited] |
Definition at line 86 of file FXBaseObject.h.
Referenced by FXEX::FXBaseObject::FXBaseObject(), FXEX::FXBaseObject::load(), FXEX::FXBaseObject::save(), and FXEX::FXBaseObject::~FXBaseObject().
FXuint FXEX::FXBaseObject::datalen [protected, inherited] |
Definition at line 87 of file FXBaseObject.h.
Referenced by FXEX::FXBaseObject::load(), and FXEX::FXBaseObject::save().
FXThreadEventHandle FXEX::FXThreadEvent::event [private] |
Definition at line 115 of file FXThreadEvent.h.
FXuint FXEX::FXBaseObject::flags [protected, inherited] |
Definition at line 88 of file FXBaseObject.h.
Referenced by FXEX::FXBaseObject::FXBaseObject(), FXEX::FXBaseObject::load(), FXEX::FXBaseObject::onUpdate(), FXEX::FXBaseObject::save(), and FXEX::FXBaseObject::setReadonly().
FXSelector FXEX::FXBaseObject::message [protected, inherited] |
Definition at line 85 of file FXBaseObject.h.
Referenced by FXEX::FXBaseObject::FXBaseObject(), FXEX::FXBaseObject::load(), and FXEX::FXBaseObject::save().
FXuint FXEX::FXBaseObject::options [protected, inherited] |
Definition at line 89 of file FXBaseObject.h.
Referenced by FXEX::FXBaseObject::load(), and FXEX::FXBaseObject::save().
FXObject* FXEX::FXBaseObject::target [protected, inherited] |
Definition at line 84 of file FXBaseObject.h.
Referenced by FXEX::FXBaseObject::FXBaseObject(), FXEX::FXBaseObject::load(), FXEX::FXBaseObject::save(), and FXEX::FXBaseObject::~FXBaseObject().