GSI Object Oriented Online Offline (Go4)  GO4-6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4Command.h
Go to the documentation of this file.
1 // $Id: TGo4Command.h 2627 2019-10-01 08:02:45Z linev $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #ifndef TGO4COMMAND_H
15 #define TGO4COMMAND_H
16 
21 #include "TNamed.h"
22 
24 class TGo4RemoteCommand;
25 
28  kGo4ComModeRefused, // no rights
29  kGo4ComModeObserver, // client may only observe
30  kGo4ComModeController, // client has full control as user
31  kGo4ComModeAdministrator // full control over everything
32 };
33 
35 class TGo4Command : public TNamed {
36  public:
37 
38  TGo4Command();
39 
40  TGo4Command(const char* name, const char* description, Int_t id);
41 
42  virtual ~TGo4Command();
43 
45  virtual Int_t ExeCom();
46 
48  virtual Int_t RefuseCom();
49 
50  virtual Bool_t Log(Int_t mode = 0);
51 
52  Bool_t IsEnabled() const;
53 
54  Bool_t IsExclusive() const;
55 
56  Bool_t IsLocal() const;
57 
58  virtual void Help();
59 
60  Int_t GetCommandID() const;
61 
62  Bool_t IsSynchron() const;
63 
64  const char* GetReceiverName() const;
65  void SetReceiverName(const char*);
66 
67  const char* GetTaskName() const;
68  void SetTaskName(const char*);
69 
70  const char* What() const;
71  void SetDescription(const char*);
72 
73  virtual void SetReceiver(TGo4CommandReceiver * rec);
74 
77 
81  virtual void Set(TGo4RemoteCommand* remcon);
82 
84 
86  static const char* GetModeDescription(Go4CommandMode_t mode);
87 
88  protected:
89 
90  Bool_t fbIsEnabled; // command can be executed
91  Bool_t fbIsExclusive; // command can be executed only by ReceiverName
92  Bool_t fbIsSynchron; // command is queued = synchronous
93  Bool_t fbIsLocal; // command is to be executed by local command thread
94 
95  Int_t fiCommandID; // command number
96  Int_t fiVersion; // version number
97 
103 
104  void SetProtection(Go4CommandMode_t m){fiProtection=m;}
105 
107  static const char* fgcMODEDESCRIPTION[];
108 
109  private:
110 
111  TString fxDescription; // short description of command
112  TString fxReceiverName; // name of receiver
113  TString fxTaskName; // name of task
114 
115  protected:
117 
118  ClassDef(TGo4Command , 1)
119 };
120 
121 #endif //TGO4COMMAND_H
virtual void Help()
Definition: TGo4Command.cxx:70
void SetReceiverName(const char *)
Definition: TGo4Command.cxx:93
Go4CommandMode_t GetProtection()
Definition: TGo4Command.h:75
virtual void Set(TGo4RemoteCommand *remcon)
Bool_t IsSynchron() const
Go4CommandMode_t fiProtection
Definition: TGo4Command.h:102
TGo4CommandReceiver * fxReceiverBase
Definition: TGo4Command.h:116
Bool_t fbIsLocal
Definition: TGo4Command.h:93
Go4CommandMode_t
Definition: TGo4Command.h:27
void SetTaskName(const char *)
Int_t GetCommandID() const
Definition: TGo4Command.cxx:64
Bool_t IsEnabled() const
Definition: TGo4Command.cxx:75
const char * GetTaskName() const
Definition: TGo4Command.cxx:99
const char * GetReceiverName() const
Definition: TGo4Command.cxx:87
virtual Int_t ExeCom()
Bool_t IsExclusive() const
Definition: TGo4Command.cxx:81
virtual void SetReceiver(TGo4CommandReceiver *rec)
TString fxReceiverName
Definition: TGo4Command.h:112
Go4CommandMode_t fiMode
Definition: TGo4Command.h:99
Int_t fiVersion
Definition: TGo4Command.h:96
virtual Bool_t Log(Int_t mode=0)
TString fxDescription
Definition: TGo4Command.h:111
TString fxTaskName
Definition: TGo4Command.h:113
Int_t fiCommandID
Definition: TGo4Command.h:95
Bool_t fbIsSynchron
Definition: TGo4Command.h:92
void SetProtection(Go4CommandMode_t m)
Definition: TGo4Command.h:104
virtual ~TGo4Command()
Definition: TGo4Command.cxx:59
void SetDescription(const char *)
Bool_t fbIsExclusive
Definition: TGo4Command.h:91
Bool_t fbIsEnabled
Definition: TGo4Command.h:90
Go4CommandMode_t GetMode()
Definition: TGo4Command.h:76
void SetMode(Go4CommandMode_t m)
Definition: TGo4Command.h:83
const char * What() const
static const char * GetModeDescription(Go4CommandMode_t mode)
virtual Int_t RefuseCom()
Bool_t IsLocal() const
static const char * fgcMODEDESCRIPTION[]
Definition: TGo4Command.h:107