GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4Command.h
Go to the documentation of this file.
1 // $Id: TGo4Command.h 1033 2013-11-05 15:30:01Z 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 für 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 #include "TString.h"
23 
25 class TGo4RemoteCommand;
26 
29  kGo4ComModeRefused, // no rights
30  kGo4ComModeObserver, // client may only observe
31  kGo4ComModeController, // client has full control as user
32  kGo4ComModeAdministrator // full control over everything
33 };
34 
36 class TGo4Command : public TNamed {
37  public:
38 
39  TGo4Command();
40 
41  TGo4Command(const char* name, const char* description, Int_t id);
42 
43  virtual ~TGo4Command ();
44 
46  virtual Int_t ExeCom();
47 
49  virtual Int_t RefuseCom();
50 
51  virtual Bool_t Log(Int_t mode = 0);
52 
53  Bool_t IsEnabled() const;
54 
55  Bool_t IsExclusive() const;
56 
57  Bool_t IsLocal() const;
58 
59  virtual void Help();
60 
61  Int_t GetCommandID() const;
62 
63  Bool_t IsSynchron() const;
64 
65  const char* GetReceiverName() const;
66  void SetReceiverName(const char*);
67 
68  const char* GetTaskName() const;
69  void SetTaskName(const char*);
70 
71  const char* What() const;
72  void SetDescription(const char*);
73 
74  virtual void SetReceiver(TGo4CommandReceiver * rec);
75 
78 
82  virtual void Set(TGo4RemoteCommand* remcon);
83 
85 
87  static const char* GetModeDescription(Go4CommandMode_t mode);
88 
89  protected:
90 
91  Bool_t fbIsEnabled; // comand can be executed
92  Bool_t fbIsExclusive; // command can be executed only by ReceiverName
93  Bool_t fbIsSynchron; // command is queued = synchronous
94  Bool_t fbIsLocal; // command is to be executed by local command thread
95 
96  Int_t fiCommandID; // command number
97  Int_t fiVersion; // version number
98 
104 
105  void SetProtection(Go4CommandMode_t m){fiProtection=m;}
106 
108  static const char* fgcMODEDESCRIPTION[];
109 
110  private:
111 
112  TString fxDescription; // short description of command
113  TString fxReceiverName; // name of receiver
114  TString fxTaskName; // name of task
115 
116  protected:
118 
119  ClassDef(TGo4Command , 1)
120 };
121 
122 #endif //TGO4COMMAND_H
virtual void Help()
Definition: TGo4Command.cxx:69
void SetReceiverName(const char *)
Definition: TGo4Command.cxx:92
Go4CommandMode_t GetProtection()
Definition: TGo4Command.h:76
virtual void Set(TGo4RemoteCommand *remcon)
Bool_t IsSynchron() const
Go4CommandMode_t fiProtection
Definition: TGo4Command.h:103
TGo4CommandReceiver * fxReceiverBase
Definition: TGo4Command.h:117
Bool_t fbIsLocal
Definition: TGo4Command.h:94
Go4CommandMode_t
Definition: TGo4Command.h:28
void SetTaskName(const char *)
Int_t GetCommandID() const
Definition: TGo4Command.cxx:63
Bool_t IsEnabled() const
Definition: TGo4Command.cxx:74
const char * GetTaskName() const
Definition: TGo4Command.cxx:98
const char * GetReceiverName() const
Definition: TGo4Command.cxx:86
virtual Int_t ExeCom()
Bool_t IsExclusive() const
Definition: TGo4Command.cxx:80
virtual void SetReceiver(TGo4CommandReceiver *rec)
TString fxReceiverName
Definition: TGo4Command.h:113
Go4CommandMode_t fiMode
Definition: TGo4Command.h:100
Int_t fiVersion
Definition: TGo4Command.h:97
virtual Bool_t Log(Int_t mode=0)
TString fxDescription
Definition: TGo4Command.h:112
TString fxTaskName
Definition: TGo4Command.h:114
Int_t fiCommandID
Definition: TGo4Command.h:96
Bool_t fbIsSynchron
Definition: TGo4Command.h:93
void SetProtection(Go4CommandMode_t m)
Definition: TGo4Command.h:105
virtual ~TGo4Command()
Definition: TGo4Command.cxx:58
void SetDescription(const char *)
Bool_t fbIsExclusive
Definition: TGo4Command.h:92
Bool_t fbIsEnabled
Definition: TGo4Command.h:91
Go4CommandMode_t GetMode()
Definition: TGo4Command.h:77
void SetMode(Go4CommandMode_t m)
Definition: TGo4Command.h:84
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:108