Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

TGo4MainRunnable.cxx

Go to the documentation of this file.
00001 //-------------------------------------------------------------
00002 //        Go4 Release Package v3.04-01 (build 30401)
00003 //                      28-November-2008
00004 //---------------------------------------------------------------
00005 //   The GSI Online Offline Object Oriented (Go4) Project
00006 //   Experiment Data Processing at EE 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 "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    // first test: simply wait for command, then execute it and send back an object
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; // protect command invocation!
00049          TGo4CommandInvoker::Instance()->Invoke(com); // execute command by invoker
00050          delete com;
00051       }
00052    else
00053       {        }
00054       // do "main event loop"...
00055       fxApplication->FillHistograms();
00056       TGo4Thread::Sleep(20);
00057         return 0;
00058 }
00059 
00060 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Fri Nov 28 12:59:31 2008 for Go4-v3.04-1 by  doxygen 1.4.2