GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
TGo4Command.h
Go to the documentation of this file.
1 // $Id$
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 
76  Go4CommandMode_t GetMode() const { return fiMode; }
77 
81  virtual void Set(TGo4RemoteCommand *remcon);
82 
83  void SetMode(Go4CommandMode_t m) { fiMode = m; }
84 
86  static const char *GetModeDescription(Go4CommandMode_t mode);
87 
88  protected:
89 
90  Bool_t fbIsEnabled{kFALSE}; // command can be executed
91  Bool_t fbIsExclusive{kFALSE}; // command can be executed only by ReceiverName
92  Bool_t fbIsSynchron{kFALSE}; // command is queued = synchronous
93  Bool_t fbIsLocal{kFALSE}; // command is to be executed by local command thread
94 
95  Int_t fiCommandID{0}; // command number
96  Int_t fiVersion{0}; // version number
97 
103 
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  ClassDefOverride(TGo4Command, 1)
119 };
120 
121 #endif //TGO4COMMAND_H
virtual void Help()
Definition: TGo4Command.cxx:70
void SetReceiverName(const char *)
Definition: TGo4Command.cxx:93
Bool_t IsLocal() const
virtual void Set(TGo4RemoteCommand *remcon)
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 *)
const char * What() const
Go4CommandMode_t GetProtection() const
Definition: TGo4Command.h:75
virtual Int_t ExeCom()
virtual void SetReceiver(TGo4CommandReceiver *rec)
Go4CommandMode_t GetMode() const
Definition: TGo4Command.h:76
TString fxReceiverName
Definition: TGo4Command.h:112
Bool_t IsExclusive() const
Definition: TGo4Command.cxx:81
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 GetCommandID() const
Definition: TGo4Command.cxx:64
const char * GetTaskName() const
Definition: TGo4Command.cxx:99
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 *)
const char * GetReceiverName() const
Definition: TGo4Command.cxx:87
Bool_t fbIsExclusive
Definition: TGo4Command.h:91
Bool_t IsEnabled() const
Definition: TGo4Command.cxx:75
Bool_t fbIsEnabled
Definition: TGo4Command.h:90
Bool_t IsSynchron() const
void SetMode(Go4CommandMode_t m)
Definition: TGo4Command.h:83
static const char * GetModeDescription(Go4CommandMode_t mode)
virtual Int_t RefuseCom()
static const char * fgcMODEDESCRIPTION[]
Definition: TGo4Command.h:107