Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

TGo4ComSetProtections.cxx

Go to the documentation of this file.
00001 //-------------------------------------------------------------
00002 //        Go4 Release Package v3.04-01 (build 30401)
00003 //                      28-November-2008
00004 //---------------------------------------------------------------
00005 //   The GSI Online Offline Object Oriented (Go4) Project
00006 //   Experiment Data Processing at EE 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 "TGo4ComSetProtections.h"
00017 
00018 #include "TGo4Log.h"
00019 #include "TGo4AnalysisClientImp.h"
00020 #include "TGo4AnalysisImp.h"
00021 #include "TGo4RemoteCommand.h"
00022 
00023 TGo4ComSetProtections::TGo4ComSetProtections(const char* obname, const char* flags)
00024 :TGo4AnalysisObjectCommand("ANSetProtect","Set protection properties for object",obname)
00025 {
00026    TRACE((12,"TGo4ComSetProtections::TGo4ComSetProtections(const Text_t*) ctor",__LINE__, __FILE__));
00027    SetReceiverName("AnalysisClient");  // this command needs client as receiver
00028                                       // override default receiver
00029    SetFlags(flags);
00030    SetProtection(kGo4ComModeController);
00031 }
00032 
00033 TGo4ComSetProtections::TGo4ComSetProtections()
00034 :TGo4AnalysisObjectCommand()
00035 {
00036    TRACE((12,"TGo4ComSetProtections::TGo4ComSetProtections() ctor",__LINE__, __FILE__));
00037    SetReceiverName("AnalysisClient");  // this command needs client as receiver
00038    SetName("ANSetProtect");
00039    SetDescription("Set protection properties for object");
00040    SetProtection(kGo4ComModeController);
00041 }
00042 
00043 TGo4ComSetProtections::~TGo4ComSetProtections()
00044 {
00045    TRACE((12,"TGo4ComSetProtections::~TGo4ComSetProtections() dtor",__LINE__, __FILE__));
00046 }
00047 
00048 void TGo4ComSetProtections::Set(TGo4RemoteCommand* remcom)
00049 {
00050 if(remcom==0) return;
00051 TGo4AnalysisObjectCommand::Set(remcom);
00052 SetFlags(remcom->GetString(2));
00053 }
00054 
00055 
00056 
00057 Int_t TGo4ComSetProtections::ExeCom()
00058 {
00059    TGo4AnalysisClient* cli=dynamic_cast<TGo4AnalysisClient*> (fxReceiverBase);
00060    if (cli!=0)
00061       {
00062          TGo4Analysis* ana=TGo4Analysis::Instance();
00063          if(ana->ProtectObjects(GetObjectName(),(const Option_t*) fxFlags.Data()))
00064             {
00065                cli->SendStatusMessage(1, kFALSE,"Changed object or folder %s protections: %s ",
00066                                                GetObjectName(),fxFlags.Data());
00067             }
00068          else
00069             {
00070                 cli->SendStatusMessage(2, kFALSE,"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 }
00083 
00084 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Fri Nov 28 12:59:05 2008 for Go4-v3.04-1 by  doxygen 1.4.2