Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/Go4CommandsBase/TGo4Command.h

Go to the documentation of this file.
00001 //---------------------------------------------------------------
00002 //        Go4 Release Package v2.10-5 (build 21005) 
00003 //                      03-Nov-2005
00004 //---------------------------------------------------------------
00005 //       The GSI Online Offline Object Oriented (Go4) Project
00006 //       Experiment Data Processing at DVEE 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 //----------------------------------------------------------------
00020 #ifndef TGO4COMMAND_H
00021 #define TGO4COMMAND_H
00022 
00023 #include "TNamed.h"
00024 #include "TString.h"
00025 
00026 class TGo4CommandReceiver;
00027 
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 
00037 
00038 
00040 class TGo4Command  : public TNamed {
00041 public:
00042 
00043     TGo4Command ();
00044 
00045     TGo4Command (const char* name, const char* description, Int_t id);
00046 
00047     virtual ~TGo4Command ();
00048 
00050     virtual Int_t ExeCom();
00051 
00053     virtual Int_t UnExeCom();
00054     
00056     virtual Int_t RefuseCom();
00057 
00058     virtual Bool_t Log(Int_t mode = 0);
00059 
00060     Bool_t IsEnabled() const;
00061 
00062     Bool_t IsExclusive() const;
00063 
00064     Bool_t IsLocal() const;
00065 
00066     virtual void Help();
00067 
00068     Int_t GetCommandID() const;
00069 
00070     Bool_t IsSynchron() const;
00071 
00072     const char* GetReceiverName() const;
00073     void SetReceiverName(const char*);
00074 
00075     const char* GetTaskName() const;
00076     void SetTaskName(const char*);
00077     
00078     const char* What() const;
00079     void SetDescription(const char*);
00080 
00081     virtual void SetReceiver(TGo4CommandReceiver * rec);
00082  
00083     Go4CommandMode_t GetProtection(){return fiProtection;}
00084     Go4CommandMode_t GetMode(){return fiMode;}
00085     
00086     void SetMode(Go4CommandMode_t m){fiMode=m;}
00087     
00089     static const char* GetModeDescription(Go4CommandMode_t mode);
00090 
00091 protected:
00092 
00093     Bool_t fbIsEnabled;   // comand can be executed
00094     Bool_t fbIsExclusive; // command can be executed only by ReceiverName
00095     Bool_t fbIsSynchron;  // command is queued = synchronous
00096     Bool_t fbIsLocal;     // command is to be executed by local command thread
00097 
00098     Int_t fiCommandID;    // command number
00099     Int_t fiVersion;      // version number
00100     
00102     Go4CommandMode_t fiMode; // 
00105     Go4CommandMode_t fiProtection; // 
00106         
00107    
00108     void SetProtection(Go4CommandMode_t m){fiProtection=m;}
00109 
00111     static char* fgcMODEDESCRIPTION[];
00112 
00113 private:
00114 
00115     TString fxDescription;  // short description of command
00116     TString fxReceiverName; // name of receiver
00117     TString fxTaskName;     // name of task
00118 
00119 protected:
00120     TGo4CommandReceiver * fxReceiverBase; 
00121 
00122     ClassDef(TGo4Command , 1) //TGo4Command
00123 };
00124 
00125 #endif //TGO4COMMAND_H
00126 
00127 
00128 
00129 
00130 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Tue Nov 8 10:55:51 2005 for Go4-v2.10-5 by doxygen1.2.15