SUMO - Simulation of Urban MObility
FXSingleEventThread.h
Go to the documentation of this file.
00001 #ifndef FXSingleEventThread_h
00002 #define FXSingleEventThread_h
00003 
00004 
00005 // ===========================================================================
00006 // included modules
00007 // ===========================================================================
00008 #ifdef _MSC_VER
00009 #include <windows_config.h>
00010 #else
00011 #include <config.h>
00012 #endif
00013 
00014 #include <fx.h>
00015 #include <FXThread.h>
00016 #include "fxexdefs.h"
00017 
00018 class MFXInterThreadEventClient;
00019 
00020 class FXSingleEventThread : public FXObject, public FXThread {
00021     FXDECLARE(FXSingleEventThread)
00022 
00023 private:
00024     FXEX::FXThreadEventHandle event;
00025 
00026 private:
00027     FXSingleEventThread(const FXSingleEventThread&);
00028     FXSingleEventThread& operator=(const FXSingleEventThread&);
00029 
00030 public:
00031     enum {
00032         ID_THREAD_EVENT
00033     };
00034 
00035 public:
00036     long onThreadSignal(FXObject*, FXSelector, void*);
00037     long onThreadEvent(FXObject*, FXSelector, void*);
00038 
00039 public:
00040     FXSingleEventThread(FXApp* a, MFXInterThreadEventClient* client);
00041 
00042     void signal();
00043 
00044     void signal(FXuint seltype);
00045 
00046     virtual FXint run() {
00047         return 0;
00048     }
00049 
00050     virtual ~FXSingleEventThread();
00051 
00052     static void sleep(long ms);
00053 
00054 private:
00055     FXApp* myApp;
00056     MFXInterThreadEventClient* myClient;
00057 
00058 protected:
00059     FXSingleEventThread() { }
00060 };
00061 
00062 
00063 #endif
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines