GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
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
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
35class TGo4Command : public TNamed {
36 public:
37
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
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
Go4CommandMode_t
These values define command execution rights.
Definition TGo4Command.h:27
@ kGo4ComModeController
Definition TGo4Command.h:30
@ kGo4ComModeRefused
Definition TGo4Command.h:28
@ kGo4ComModeObserver
Definition TGo4Command.h:29
@ kGo4ComModeAdministrator
Definition TGo4Command.h:31
This is the Go4 Abstract Command Class; part of the Base command pattern.
Definition TGo4Command.h:35
TString fxDescription
Int_t fiCommandID
Definition TGo4Command.h:95
Bool_t fbIsExclusive
Definition TGo4Command.h:91
Bool_t IsLocal() const
static const char * GetModeDescription(Go4CommandMode_t mode)
text description of current execution mode
Bool_t fbIsLocal
Definition TGo4Command.h:93
virtual Bool_t Log(Int_t mode=0)
virtual Int_t RefuseCom()
Optional action if command is not allowed (warning message e.g.)
void SetProtection(Go4CommandMode_t m)
const char * What() const
TGo4CommandReceiver * fxReceiverBase
virtual void Set(TGo4RemoteCommand *remcon)
Set internals of this command from specification of external remote command (command container).
Bool_t IsExclusive() const
Bool_t IsSynchron() const
void SetDescription(const char *)
Bool_t fbIsSynchron
Definition TGo4Command.h:92
Go4CommandMode_t GetProtection() const
Definition TGo4Command.h:75
static const char * fgcMODEDESCRIPTION[]
resolve description of command modes here
Definition TGo4Command.h:20
virtual Int_t ExeCom()
Do the command action.
TString fxReceiverName
void SetMode(Go4CommandMode_t m)
Definition TGo4Command.h:83
Bool_t fbIsEnabled
Definition TGo4Command.h:90
void SetReceiverName(const char *)
virtual void SetReceiver(TGo4CommandReceiver *rec)
Go4CommandMode_t fiProtection
Execute protection of this command.
TString fxTaskName
const char * GetTaskName() const
virtual ~TGo4Command()
Bool_t IsEnabled() const
Go4CommandMode_t GetMode() const
Definition TGo4Command.h:76
Go4CommandMode_t fiMode
mode value for execution rights of sending task
Definition TGo4Command.h:99
void SetTaskName(const char *)
const char * GetReceiverName() const
Int_t GetCommandID() const
Int_t fiVersion
Definition TGo4Command.h:96
virtual void Help()
This command is a container for commands to be send from master to slave via inter-process transport.