Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "TGo4ComSetProtections.h"
00015
00016 #include "TGo4Log.h"
00017 #include "TGo4AnalysisClientImp.h"
00018 #include "TGo4AnalysisImp.h"
00019 #include "TGo4RemoteCommand.h"
00020
00021 TGo4ComSetProtections::TGo4ComSetProtections(const char* obname, const char* flags)
00022 :TGo4AnalysisObjectCommand("ANSetProtect","Set protection properties for object",obname)
00023 {
00024 GO4TRACE((12,"TGo4ComSetProtections::TGo4ComSetProtections(const char*) ctor",__LINE__, __FILE__));
00025 SetReceiverName("AnalysisClient");
00026
00027 SetFlags(flags);
00028 SetProtection(kGo4ComModeController);
00029 }
00030
00031 TGo4ComSetProtections::TGo4ComSetProtections()
00032 :TGo4AnalysisObjectCommand()
00033 {
00034 GO4TRACE((12,"TGo4ComSetProtections::TGo4ComSetProtections() ctor",__LINE__, __FILE__));
00035 SetReceiverName("AnalysisClient");
00036 SetName("ANSetProtect");
00037 SetDescription("Set protection properties for object");
00038 SetProtection(kGo4ComModeController);
00039 }
00040
00041 TGo4ComSetProtections::~TGo4ComSetProtections()
00042 {
00043 GO4TRACE((12,"TGo4ComSetProtections::~TGo4ComSetProtections() dtor",__LINE__, __FILE__));
00044 }
00045
00046 void TGo4ComSetProtections::Set(TGo4RemoteCommand* remcom)
00047 {
00048 if(remcom==0) return;
00049 TGo4AnalysisObjectCommand::Set(remcom);
00050 SetFlags(remcom->GetString(2));
00051 }
00052
00053
00054
00055 Int_t TGo4ComSetProtections::ExeCom()
00056 {
00057 TGo4AnalysisClient* cli=dynamic_cast<TGo4AnalysisClient*> (fxReceiverBase);
00058 if (cli!=0)
00059 {
00060 TGo4Analysis* ana=TGo4Analysis::Instance();
00061 if(ana->ProtectObjects(GetObjectName(),(const Option_t*) fxFlags.Data()))
00062 {
00063 cli->SendStatusMessage(1, kFALSE,TString::Format(
00064 "Changed object or folder %s protections: %s ",
00065 GetObjectName(),fxFlags.Data()));
00066 }
00067 else
00068 {
00069 cli->SendStatusMessage(2, kFALSE,TString::Format(
00070 "Could not change object/folder %s protections, no such object",
00071 GetObjectName()));
00072 }
00073 }
00074 else
00075
00076 {
00077 TGo4Log::Debug(" !!! %s : NO RECEIVER ERROR!!!",GetName());
00078 return 1;
00079 }
00080
00081 return -1;
00082 }