GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4UserSourceParameter.cxx
Go to the documentation of this file.
1 // $Id: TGo4UserSourceParameter.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 #include "Go4EventServerTypes.h"
19 
20 TGo4UserSourceParameter::TGo4UserSourceParameter(const char* name, const char* expr, Int_t port)
21 : TGo4EventSourceParameter(name, GO4EV_USER), fiPort(port), fxExpression(expr)
22 {
23 }
24 
26 : TGo4EventSourceParameter("default user event source", GO4EV_USER), fiPort(0)
27 {
28 }
29 
31 {
32 }
33 
34 Int_t TGo4UserSourceParameter::PrintParameter(Text_t* buffer, Int_t buflen)
35 {
36  GO4TRACE((12,"TGo4UserSourceParameter::PrintParameter()",__LINE__, __FILE__));
37  Int_t locallen=128000;
38  Text_t localbuf[128000];
39  if(buflen<0 && buffer!=0)
40  return 0;
41  Int_t size=0;
42  Text_t* current=localbuf;
43  Int_t restlen=locallen;
44 
45  Int_t delta=TGo4EventSourceParameter::PrintParameter(current,restlen);
46  restlen-=delta;
47  current+=delta;
48  current=TGo4Status::PrintIndent(current,restlen);
49  current=TGo4Status::PrintBuffer(current,restlen, " Expression: %s\n",GetExpression());
50  if(buffer==0)
51  {
52  std::cout << localbuf << std::endl;
53  }
54  else
55  {
56  size=locallen-restlen;
57  if(size>buflen-1)
58  size=buflen-1;
59  strncpy(buffer,localbuf,size);
60  }
61  return size;
62 }
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)
const char * GetExpression() const
#define GO4TRACE(X)
Definition: TGo4Log.h:26
virtual Int_t PrintParameter(Text_t *buffer=0, Int_t buflen=0)
static Text_t * PrintBuffer(char *buffer, Int_t &buflen, const char *text,...)
Definition: TGo4Status.cxx:85