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