GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
TGo4UserSourceParameter.cxx
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 
15 
16 #include "TGo4Status.h"
17 #include "Go4EventServerTypes.h"
18 
19 TGo4UserSourceParameter::TGo4UserSourceParameter(const char *name, const char *expr, Int_t port)
20 : TGo4EventSourceParameter(name, GO4EV_USER), fiPort(port), fxExpression(expr)
21 {
22 }
23 
25 : TGo4EventSourceParameter("default user event source", GO4EV_USER)
26 {
27 }
28 
30 {
31 }
32 
33 void TGo4UserSourceParameter::Print(Option_t *) const
34 {
36  if (GetPort() > 0)
37  TGo4Status::PrintLine(" Port %d", GetPort());
38  TGo4Status::PrintLine(" Expression: %s", GetExpression());
39 }
40 
42 {
43  if(rhs && rhs->InheritsFrom(TGo4UserSourceParameter::Class())) {
44  auto userpar = dynamic_cast<TGo4UserSourceParameter*>(rhs);
45  if(!userpar) return kFALSE;
46  if(!TGo4EventSourceParameter::UpdateFrom(rhs)) return kFALSE;
47  SetPort(userpar->GetPort());
48  SetExpression(userpar->GetExpression());
49  return kTRUE;
50  }
51  return kFALSE;
52 }
53 
Bool_t UpdateFrom(TGo4Parameter *rhs) override
Bool_t UpdateFrom(TGo4Parameter *rhs) override
const char * GetExpression() const
void Print(Option_t *opt="") const override
void SetExpression(const char *name)
static void PrintLine(const char *text,...)
Definition: TGo4Status.cxx:101
void Print(Option_t *opt="") const override