GSI Object Oriented Online Offline (Go4)  GO4-6.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4RemoteCommand.cxx
Go to the documentation of this file.
1 // $Id: TGo4RemoteCommand.cxx 2745 2020-04-16 08:55:15Z 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 #include "TGo4RemoteCommand.h"
15 
16 #include "TGo4CommandInvoker.h"
17 
18 const char* TGo4RemoteCommand::fgxREMCOMEMPTYSTRING="--NOSTRING--";
19 
21  TGo4Command(),
22  fxCommandName("THStop"),
23  fxAggregate(0)
24 {
25  InitPars();
26 }
27 
29  TGo4Command(),
30  fxCommandName(comname),
31  fxAggregate(0)
32 {
33  InitPars();
34 }
35 
37 {
38  SetName("BS_Remote");
39  SetDescription("Container for remote commands");
40  SetReceiverName("CommandInvoker");
41  fiCommandID = 888;
42  fiVersion = 3;
43  fbIsSynchron = kFALSE;
44  fbIsEnabled = kTRUE;
45  fbIsExclusive = kFALSE;
46  fbIsLocal = kFALSE;
47  for(Int_t j=0;j<__REMCOMPARS__; j++) {
49  fiValue[j]=0;
50  }
51 }
52 
54 {
55  //delete fxAggregate; // never delete aggregate owned by gui object manager!
56 }
57 
59 {
61  if(inv==0) return -1;
62  Int_t rev=inv->ExecuteFromRemote(this);
63  delete fxAggregate; // only cleanup on executer side if necessary!
64  return rev;
65 }
66 
68 {
69  delete fxAggregate;
70  fxAggregate = ob;
71 }
72 
73 TObject* TGo4RemoteCommand::GetAggregate(Bool_t chown)
74 {
75  TObject* rev=fxAggregate;
76  if(chown) fxAggregate=0; // change ownership to external client
77  return rev;
78 }
79 
80 void TGo4RemoteCommand::SetString(const char* txt,Int_t i)
81 {
82  if ((i>=0) && (i<__REMCOMPARS__)) fxParameter[i]=txt;
83 }
84 
85 const char* TGo4RemoteCommand::GetString(Int_t i) const
86 {
87  return ((i>=0) && (i<__REMCOMPARS__)) ? fxParameter[i].Data() : 0;
88 }
89 
90 void TGo4RemoteCommand::SetValue(Int_t num, Int_t i)
91 {
92  if((i>=0) && (i<__REMCOMPARS__)) fiValue[i]=num;
93 }
94 
95 Int_t TGo4RemoteCommand::GetValue(Int_t i) const
96 {
97  return ((i>=0) && (i<__REMCOMPARS__)) ? fiValue[i] : 0;
98 }
99 
101 {
102  return fgxREMCOMEMPTYSTRING;
103 }
Int_t fiValue[__REMCOMPARS__]
void SetReceiverName(const char *)
Definition: TGo4Command.cxx:93
TGo4CommandReceiver * fxReceiverBase
Definition: TGo4Command.h:116
Bool_t fbIsLocal
Definition: TGo4Command.h:93
TObject * GetAggregate(Bool_t chown=kTRUE)
void SetAggregate(TObject *ob)
#define __REMCOMPARS__
Int_t GetValue(Int_t i) const
Int_t fiVersion
Definition: TGo4Command.h:96
Int_t ExecuteFromRemote(TGo4RemoteCommand *remcom)
Int_t fiCommandID
Definition: TGo4Command.h:95
TString fxParameter[__REMCOMPARS__]
Bool_t fbIsSynchron
Definition: TGo4Command.h:92
void SetDescription(const char *)
const char * GetString(Int_t i) const
void SetValue(Int_t num, Int_t i)
void SetString(const char *txt, Int_t i)
Bool_t fbIsExclusive
Definition: TGo4Command.h:91
Bool_t fbIsEnabled
Definition: TGo4Command.h:90
static const char * Get_fgxREMCOMEMPTYSTRING()
static const char * fgxREMCOMEMPTYSTRING