Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/Go4TaskHandlerExample/TGo4MainRunnable.cxx

Go to the documentation of this file.
00001 //---------------------------------------------------------------
00002 //        Go4 Release Package v2.10-5 (build 21005) 
00003 //                      03-Nov-2005
00004 //---------------------------------------------------------------
00005 //       The GSI Online Offline Object Oriented (Go4) Project
00006 //       Experiment Data Processing at DVEE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
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    // first test: simply wait for command, then execute it and send back an object
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; // protect command invocation!
00046          TGo4CommandInvoker::Instance()->Invoke(com); // execute command by invoker
00047          delete com;
00048       }
00049    else
00050       {        }
00051       // do "main event loop"...
00052       fxApplication->FillHistograms();
00053       TGo4Thread::Sleep(20);
00054         return 0;
00055 }
00056 
00057 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Tue Nov 8 10:56:07 2005 for Go4-v2.10-5 by doxygen1.2.15