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

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

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