00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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");
00027
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");
00037
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 }
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 }
00080
00081 return -1;
00082 }
00083
00084 ClassImp(TGo4ComDeleteObject)
00085
00086