GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4EventSourceParameter.cxx
Go to the documentation of this file.
1 // $Id: TGo4EventSourceParameter.cxx 999 2013-07-25 11:58:59Z 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 
15 
16 #include "TGo4Status.h"
17 #include "TGo4Log.h"
18 
20 
22 : TGo4Parameter (name), fiID(id),
24 {
25  GO4TRACE((12,"TGo4EventSourceParameter::TGo4EventSourceParameter(const char*)",__LINE__, __FILE__));
26 }
27 
28 
30 : TGo4Parameter ("Default Event Source Parameter"), fiID(0),
32 {
33  GO4TRACE((12,"TGo4EventSourceParameter::TGo4EventSourceParameter()",__LINE__, __FILE__));
34 }
35 
37 {
38  GO4TRACE((12,"TGo4EventSourceParameter::~TGo4EventSourceParameter()",__LINE__, __FILE__));
39 }
40 
41 Int_t TGo4EventSourceParameter::PrintParameter(Text_t* buffer, Int_t buflen)
42 {
43  GO4TRACE((12,"TGo4EventSourceParameter::PrintParameter()",__LINE__, __FILE__));
44  Int_t locallen=64000;
45  Text_t localbuf[64000];
46  if(buflen<0 && buffer!=0)
47  return 0;
48  Int_t size=0;
49  Int_t restlen=locallen;
50  Text_t* current=localbuf;
51  current=TGo4Status::PrintIndent(current,restlen);
52  TString woparam=ClassName();
53  woparam.ReplaceAll("Parameter","");
54  current=TGo4Status::PrintBuffer(current,restlen, "Eventsource: %s \n",woparam.Data());
55  current=TGo4Status::PrintIndent(current,restlen);
56  current=TGo4Status::PrintBuffer(current,restlen, " Name: \t%s \n",GetName());
57  current=TGo4Status::PrintIndent(current,restlen);
58  current=TGo4Status::PrintBuffer(current,restlen, " Timeout: \t%d s\n",GetTimeout());
59 // current=TGo4Status::PrintIndent(current,restlen);
60 // current=TGo4Status::PrintBuffer(current,restlen, " ID: \t\t%d \n",GetID());
61  if(buffer==0)
62  {
63  std::cout << localbuf << std::endl;
64  }
65  else
66  {
67  size=locallen-restlen;
68  if(size>buflen-1)
69  size=buflen-1;
70  strncpy(buffer,localbuf,size);
71  }
72  return size;
73 }
74 
76 {
77  GO4TRACE((12,"TGo4EventSourceParameter::UpdateFrom()",__LINE__, __FILE__));
78  TGo4EventSourceParameter* srcpar=dynamic_cast<TGo4EventSourceParameter*>(rhs);
79  if (srcpar==0) return kFALSE;
80  SetName(srcpar->GetName());
81  SetTimeout(srcpar->GetTimeout());
82  fiID=srcpar->GetID();
83  return kTRUE;
84 }
virtual Bool_t UpdateFrom(TGo4Parameter *rhs)
static Text_t * PrintIndent(Text_t *buffer, Int_t &buflen)
Definition: TGo4Status.cxx:72
virtual Int_t PrintParameter(Text_t *buffer=0, Int_t buflen=0)
#define GO4TRACE(X)
Definition: TGo4Log.h:26
const Int_t TGo4EventSource__fgiTIMEOUTDEFAULT
static Text_t * PrintBuffer(char *buffer, Int_t &buflen, const char *text,...)
Definition: TGo4Status.cxx:85