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