MeVisLabToolboxReference
MeVis/Foundation/Sources/MLBackgroundTasks/mlBackgroundTaskMessage.h
Go to the documentation of this file.
00001 // **InsertLicense** code
00002 //----------------------------------------------------------------------------------
00009 //----------------------------------------------------------------------------------
00010 
00011 
00012 #ifndef __mlBackgroundTaskMessage_H
00013 #define __mlBackgroundTaskMessage_H
00014 
00015 
00016 // Local includes
00017 #include "MLBackgroundTasksSystem.h"
00018 
00019 #include "mlModuleIncludes.h"
00020 
00021 ML_START_NAMESPACE
00022 
00023 //-----------------------------------------------------------------------
00024 class BackgroundTask;
00025 
00026 class MLBACKGROUNDTASKS_EXPORT BackgroundTaskMessage {
00027 public:
00028   BackgroundTaskMessage() { _sender = NULL; }
00029   virtual ~BackgroundTaskMessage() {}
00030 
00032   void setSender(BackgroundTask* task) { _sender = task; }
00033 
00035   BackgroundTask* sender() { return _sender; }
00036 
00038   virtual void execute() = 0;
00039 
00042   virtual void executeSynchronous() { execute(); }
00043 
00047   virtual bool finishedProcessing() { return true; }
00048 
00050   virtual void taskWillBeDestroyed();
00051 
00052 private:
00053   BackgroundTask* _sender;
00054 };
00055 
00056 //-----------------------------------------------------------------------
00057 
00058 ML_END_NAMESPACE
00059 
00060 #endif
00061 
00062