00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "TGo4MainRunnable.h"
00015
00016 #include "TGo4Log.h"
00017 #include "TGo4LockGuard.h"
00018 #include "TGo4Thread.h"
00019
00020 #include "TGo4CommandInvoker.h"
00021 #include "TGo4LogicException.h"
00022
00023 TGo4MainRunnable::TGo4MainRunnable(const char* name, TGo4ExampleClient* cli)
00024 : TGo4Runnable(name,cli)
00025 {
00026 TRACE((15,"TGo4MainRunnable::TGo4MainRunnable(const char*,TGo4ExampleClient*) constructor",__LINE__, __FILE__));
00027 fxApplication=cli->GetApplication();
00028 }
00029
00030 TGo4MainRunnable::~TGo4MainRunnable()
00031 {
00032 TRACE((15,"TGo4MainRunnable::~TGo4MainRunnable() destructor",__LINE__, __FILE__));
00033 }
00034
00035 Int_t TGo4MainRunnable::Run(void*)
00036 {
00037 TRACE((12,"TGo4MainRunnable::Run()",__LINE__, __FILE__));
00038
00039 TGo4Command* com=0;
00040 TGo4ExampleClient* cli= dynamic_cast<TGo4ExampleClient*> (fxManager);
00041 if(!cli)
00042 throw TGo4LogicException();
00043 com=cli->NextCommand();
00044 if(com!=0)
00045 {
00046 TGo4LockGuard mainlock;
00047 TGo4CommandInvoker::Instance()->Invoke(com);
00048 delete com;
00049 }
00050 else
00051 { }
00052
00053 fxApplication->FillHistograms();
00054 TGo4Thread::Sleep(20);
00055 return 0;
00056 }