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

/Go4TaskHandler/TGo4TaskOwner.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 /* Generated by Together */
00017 
00018 #include "TGo4TaskOwner.h"
00019 #include "TGo4Task.h"
00020 #include "TGo4ServerTask.h"
00021 #include "TGo4ClientTask.h"
00022 #include "Go4Log/TGo4Log.h"
00023 #include <Rtypes.h>
00024 #include <iostream>
00025 
00026 using namespace std;
00027 
00028 TGo4TaskOwner::TGo4TaskOwner() 
00029 : fxTask(0),fbServerMode(kTRUE) 
00030 { 
00031 
00032 }
00033 
00034 
00035 TGo4TaskOwner::TGo4TaskOwner(Bool_t isserver)
00036 : fxTask(0), fbServerMode(isserver) 
00037 { 
00038  
00039 }
00040 
00041 TGo4TaskOwner::~TGo4TaskOwner() 
00042 { 
00043    if(fxTask)
00044       fxTask->SetOwner(0); // avoid the task to delete us again in dtor  
00045    delete fxTask;       
00046 }
00047 void TGo4TaskOwner::Quit()
00048 {
00049    fxTask->Quit();
00050 }
00051 
00052 Int_t TGo4TaskOwner::StartWorkThreads()
00053 {
00054    TGo4Log::Debug(" Task Owner: default StartWorkThreads() ");
00055    fxTask->SetWorkIsStopped(kFALSE);
00056    return 0;
00057 }
00058 Int_t TGo4TaskOwner::StopWorkThreads()
00059 {
00060    TGo4Log::Debug(" Task Owner: default StopWorkThreads() ");
00061    fxTask->SetWorkIsStopped(kTRUE);
00062    return 0;
00063 }
00064 
00065 
00066 Bool_t TGo4TaskOwner::IsConnected()
00067 {
00068 if(IsServer())
00069    {
00070       TGo4ServerTask* server=dynamic_cast<TGo4ServerTask*>(GetTask());  
00071       if(server==0) 
00072          {
00073             cerr <<"NEVER COME HERE: servermode without servertask in taskowner "<< GetName() << endl;
00074             return kFALSE;
00075          }
00076       return (server->GetCurrentTaskHandler()!=0);
00077    }
00078 else
00079    {
00080       TGo4ClientTask* client=dynamic_cast<TGo4ClientTask*>(GetTask()); 
00081       if(client==0) 
00082          {
00083             cerr <<"NEVER COME HERE: clientmode without clienttask in taskowner "<< GetName() << endl;
00084             return kFALSE;
00085          }
00086       return (client->IsConnected());
00087    }      
00088    
00089 }
00090 
00091 //----------------------------END OF GO4 SOURCE FILE ---------------------

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