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

/Go4CommandsAnalysis/TGo4ComGetEnvelope.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 "TGo4ComGetEnvelope.h"
00017 
00018 #include <iostream.h>
00019 
00020 #include "TH1.h"
00021 #include "Go4Log/TGo4Log.h"
00022 #include "Go4AnalysisClient/TGo4AnalysisClientImp.h"
00023 #include "Go4Analysis/TGo4AnalysisImp.h"
00024 #include "TGo4ObjEnvelope.h"
00025 
00026 TGo4ComGetEnvelope::TGo4ComGetEnvelope(const char* obname, const char* foldername)
00027 :TGo4AnalysisObjectCommand("ANGetEnvelope","Get an arbitrary object from analysis",obname)
00028 {
00029    TRACE((12,"TGo4ComGetEnvelope::TGo4ComGetEnvelope(const Text_t*) ctor",__LINE__, __FILE__));
00030    SetReceiverName("AnalysisClient");  // this command needs client as receiver
00031    SetFolderName(foldername);
00032 }
00033 
00034 TGo4ComGetEnvelope::TGo4ComGetEnvelope()
00035 :TGo4AnalysisObjectCommand()
00036 {
00037    TRACE((12,"TGo4ComGetEnvelope::TGo4ComGetEnvelope() ctor",__LINE__, __FILE__));
00038    SetReceiverName("AnalysisClient");  // this command needs client as receiver
00039    SetName("ANGetEnvelope");
00040    SetDescription("Get an arbitrary object from analysis");
00041 }
00042 
00043 TGo4ComGetEnvelope::~TGo4ComGetEnvelope()
00044 {
00045    TRACE((12,"TGo4ComGetEnvelope::~TGo4ComGetEnvelope() dtor",__LINE__, __FILE__));
00046 }
00047 
00048 Int_t TGo4ComGetEnvelope::ExeCom()
00049 {
00050    TRACE((12,"TGo4ComGetEnvelope::ExeCom()",__LINE__, __FILE__));
00051 
00052    TGo4AnalysisClient* cli=dynamic_cast<TGo4AnalysisClient*> (fxReceiverBase);
00053    if (cli!=0)
00054       {
00055       TRACE((11,"TGo4ComGetEnvelope::ExeCom() - found valid receiver",__LINE__, __FILE__));
00056 //         cli->SendStatusMessage(1, kFALSE,"Object %s was requested from analysis...",
00057 //                                                GetObjectName());
00058          //cli->SendAnalysisObject(GetObjectName());
00059          TNamed* obj = TGo4Analysis::Instance()->GetObject( GetObjectName(), GetFolderName());
00060          
00061 //         if ((obj!=0) && (obj->InheritsFrom(TH1::Class())))
00062 //           ((TH1*)obj)->SetDirectory(0);
00063 //         if (obj==0) obj = new TNamed();  
00064          
00065          TGo4ObjEnvelope* envelope = new TGo4ObjEnvelope(obj, GetObjectName(), GetFolderName());
00066          cli->SendObject(envelope, GetTaskName());
00067          delete envelope;
00068 //         if(ob)
00069 //            cout <<"ComGetObject Sending object "<<ob->GetName() << endl;
00070       }
00071    else
00072 
00073        {
00074       TRACE((11,"TGo4ComGetEnvelope::ExeCom() - no receiver specified ERROR!",__LINE__, __FILE__));
00075          TGo4Log::Debug(" !!! %s : NO RECEIVER ERROR!!!",GetName());
00076          return 1;
00077       }
00078 
00079    return -1;
00080 }
00081 
00082 
00083 //----------------------------END OF GO4 SOURCE FILE ---------------------

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