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

/Go4CommandsAnalysis/TGo4ComClearObject.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 "TGo4ComClearObject.h"
00017 
00018 #include "Go4Log/TGo4Log.h"
00019 #include "Go4Analysis/TGo4AnalysisImp.h"
00020 #include "Go4AnalysisClient/TGo4AnalysisClientImp.h"
00021 
00022 TGo4ComClearObject::TGo4ComClearObject()
00023 :TGo4AnalysisObjectCommand("ANClearObject",
00024                            "clears object by name",
00025                            "his")
00026 {
00027    TRACE((12,"TGo4ComClearObject::TGo4ComClearObject() ctor",__LINE__, __FILE__));
00028    SetReceiverName("AnalysisClient");  // this command needs client as receiver
00029                                        // to send back status message
00030    SetProtection(kGo4ComModeController);
00031 }
00032 
00033 TGo4ComClearObject::TGo4ComClearObject(const char* name)
00034 :TGo4AnalysisObjectCommand("ANClearObject",
00035                            "clears object by name",
00036                            name)
00037 {
00038    TRACE((12,"TGo4ComClearObject::TGo4ComClearObject(Text_t*) ctor",__LINE__, __FILE__));
00039    SetReceiverName("AnalysisClient");  // this command needs client as receiver
00040                                       // to send back status message
00041    SetProtection(kGo4ComModeController);
00042 }
00043 
00044 
00045 TGo4ComClearObject::~TGo4ComClearObject()
00046 {
00047    TRACE((12,"TGo4ComClearObject::~TGo4ComClearObject() dtor",__LINE__, __FILE__));
00048 }
00049 
00050 
00051 
00052 Int_t TGo4ComClearObject::ExeCom()
00053 {
00054    TRACE((12,"TGo4ComClearObject::ExeCom()",__LINE__, __FILE__));
00055 
00056    TGo4AnalysisClient* cli=dynamic_cast<TGo4AnalysisClient*> (fxReceiverBase);
00057    if(cli)
00058       {
00059          TGo4Analysis* ana=TGo4Analysis::Instance();
00060          if(ana)
00061             {
00062                const Text_t* obname = GetObjectName();
00063                Bool_t ok=ana->ClearObjects(obname);
00064                if(ok)
00065                   {
00066                     cli->SendStatusMessage(1,kTRUE,"Object %s was cleared.", obname);
00067                   }
00068                else
00069                   {
00070                      cli->SendStatusMessage(2,kTRUE,"Could not clear object %s", obname);
00071                   } // if(ob)
00072             }
00073          else
00074             {
00075                cli->SendStatusMessage(3, kTRUE," %s ERROR no analysis ", GetName());
00076             } // if(ana)
00077       }
00078    else
00079       {
00080       TRACE((11,"TGo4ComClearObject::ExeCom() - no receiver specified ERROR!",__LINE__, __FILE__));
00081          TGo4Log::Debug(" !!! %s: NO RECEIVER ERROR!!!",GetName());
00082          return 1;
00083       }
00084 
00085    return -1;
00086 }
00087 
00088 ClassImp(TGo4ComClearObject)
00089 
00090 //----------------------------END OF GO4 SOURCE FILE ---------------------

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