Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "TGo4ComDeleteObject.h"
00015
00016 #include "TGo4Log.h"
00017 #include "TGo4AnalysisImp.h"
00018 #include "TGo4AnalysisClientImp.h"
00019
00020 TGo4ComDeleteObject::TGo4ComDeleteObject(const char* obname)
00021 :TGo4AnalysisObjectCommand("ANDelete","delete object by name", obname)
00022 {
00023 GO4TRACE((12,"TGo4ComDeleteObject::TGo4ComDeleteObject(const char*) ctor",__LINE__, __FILE__));
00024 SetReceiverName("AnalysisClient");
00025
00026
00027 SetProtection(kGo4ComModeController);
00028 }
00029
00030 TGo4ComDeleteObject::TGo4ComDeleteObject()
00031 :TGo4AnalysisObjectCommand("ANDelete","delete object by name", "dummy")
00032 {
00033 GO4TRACE((12,"TGo4ComDeleteObject::TGo4ComDeleteObject() ctor",__LINE__, __FILE__));
00034 SetReceiverName("AnalysisClient");
00035
00036 SetProtection(kGo4ComModeController);
00037 }
00038
00039 TGo4ComDeleteObject::~TGo4ComDeleteObject()
00040 {
00041 GO4TRACE((12,"TGo4ComDeleteObject::~TGo4ComDeleteObject() dtor",__LINE__, __FILE__));
00042 }
00043
00044 Int_t TGo4ComDeleteObject::ExeCom()
00045 {
00046 GO4TRACE((12,"TGo4ComDeleteObject::ExeCom()",__LINE__, __FILE__));
00047
00048 TGo4AnalysisClient* cli=dynamic_cast<TGo4AnalysisClient*> (fxReceiverBase);
00049 if(cli==0) {
00050 GO4TRACE((11,"TGo4ComDeleteObject::ExeCom() - no receiver specified ERROR!",__LINE__, __FILE__));
00051 TGo4Log::Debug(" !!! %s : NO RECEIVER ERROR!!!",GetName());
00052 return 1;
00053 }
00054
00055 TGo4Analysis* ana =TGo4Analysis::Instance();
00056 if(ana)
00057 {
00058 const char* obname = GetObjectName();
00059 if(ana->DeleteObjects(obname))
00060 {
00061 cli->SendStatusMessage(1,kTRUE,TString::Format(
00062 "Deleted Object %s (all deletables of this folder, resp.)", obname));
00063 }
00064 else
00065 {
00066 cli->SendStatusMessage(2,kTRUE,TString::Format(
00067 "Could not delete object %s !", obname));
00068 }
00069 }
00070 else
00071 {
00072 cli->SendStatusMessage(3, kTRUE,TString::Format(
00073 " %s ERROR no analysis ", GetName()));
00074 }
00075
00076 return -1;
00077 }