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