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

TGo4Command.h

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 #ifndef TGO4COMMAND_H
00017 #define TGO4COMMAND_H
00018 
00023 #include "TNamed.h"
00024 #include "TString.h"
00025 
00026 class TGo4CommandReceiver;
00027 class TGo4RemoteCommand;
00028 
00030 enum Go4CommandMode_t{
00031    kGo4ComModeRefused,     // no rights
00032    kGo4ComModeObserver,    // client may only observe
00033    kGo4ComModeController,  // client has full control as user
00034    kGo4ComModeAdministrator // full control over everything
00035 };
00036 
00038 class TGo4Command  : public TNamed {
00039    public:
00040 
00041       TGo4Command();
00042 
00043       TGo4Command(const char* name, const char* description, Int_t id);
00044 
00045       virtual ~TGo4Command ();
00046 
00048       virtual Int_t ExeCom();
00049 
00051       virtual Int_t UnExeCom();
00052 
00054       virtual Int_t RefuseCom();
00055 
00056       virtual Bool_t Log(Int_t mode = 0);
00057 
00058       Bool_t IsEnabled() const;
00059 
00060       Bool_t IsExclusive() const;
00061 
00062       Bool_t IsLocal() const;
00063 
00064       virtual void Help();
00065 
00066       Int_t GetCommandID() const;
00067 
00068       Bool_t IsSynchron() const;
00069 
00070       const char* GetReceiverName() const;
00071       void SetReceiverName(const char*);
00072 
00073       const char* GetTaskName() const;
00074       void SetTaskName(const char*);
00075 
00076       const char* What() const;
00077       void SetDescription(const char*);
00078 
00079       virtual void SetReceiver(TGo4CommandReceiver * rec);
00080 
00081       Go4CommandMode_t GetProtection(){return fiProtection;}
00082       Go4CommandMode_t GetMode(){return fiMode;}
00083 
00087        virtual void Set(TGo4RemoteCommand* remcon);
00088 
00089        void SetMode(Go4CommandMode_t m){fiMode=m;}
00090 
00092        static const char* GetModeDescription(Go4CommandMode_t mode);
00093 
00094    protected:
00095 
00096       Bool_t fbIsEnabled;   // comand can be executed
00097       Bool_t fbIsExclusive; // command can be executed only by ReceiverName
00098       Bool_t fbIsSynchron;  // command is queued = synchronous
00099       Bool_t fbIsLocal;     // command is to be executed by local command thread
00100 
00101       Int_t fiCommandID;    // command number
00102       Int_t fiVersion;      // version number
00103 
00105       Go4CommandMode_t fiMode; //
00108       Go4CommandMode_t fiProtection; //
00109 
00110       void SetProtection(Go4CommandMode_t m){fiProtection=m;}
00111 
00113        static const char* fgcMODEDESCRIPTION[];
00114 
00115    private:
00116 
00117       TString fxDescription;  // short description of command
00118       TString fxReceiverName; // name of receiver
00119       TString fxTaskName;     // name of task
00120 
00121    protected:
00122       TGo4CommandReceiver * fxReceiverBase; 
00123 
00124    ClassDef(TGo4Command , 1)
00125 };
00126 
00127 #endif //TGO4COMMAND_H
00128 
00129 //----------------------------END OF GO4 SOURCE FILE ---------------------

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