GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4ExampleClientStatus.cxx
Go to the documentation of this file.
1 // $Id: TGo4ExampleClientStatus.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 "TH1.h"
17 #include "Riostream.h"
18 
19 #include "TGo4Log.h"
20 
22 {
23  GO4TRACE((12,"TGo4ExampleClientStatus::TGo4ExampleClientStatus(const char*)",__LINE__, __FILE__));
24 }
25 
27 {
28  GO4TRACE((12,"TGo4ClientStatus::SetHistoStatus(TH1*)",__LINE__, __FILE__));
29  fxHistogramName = histogram->GetName();
30  // here the complete internal histogram information may be stored; we leave that
31  // as an exercise for the reader!
32 }
33 
34 void TGo4ExampleClientStatus::SetNames(const char* main, const char* watch)
35 {
36  GO4TRACE((12,"TGo4ClientStatus::SetNames(const char*,...)",__LINE__, __FILE__));
37  fxMainName = main;
38  fxWatchName = watch;
39 }
40 
41 Int_t TGo4ExampleClientStatus::PrintStatus(Text_t* buffer, Int_t buflen)
42 {
43  GO4TRACE((12,"TGo4ExampleClientStatus::PrintStatus()",__LINE__, __FILE__));
44  //
45  if(buflen<=0 && buffer!=0)return 0;
46  Int_t locallen=4096;
47  Text_t localbuf[4096];
48  Text_t* current=localbuf;
49  Int_t size=0;
50  Int_t restlen=locallen;
51 
52  current=PrintBuffer(current,restlen, "G-OOOO-> ExampleClient Status Class %s Printout: <-OOOO-G\n",GetName());
53  current=PrintBuffer(current,restlen, "G-OOOO-> ---------------------------------------------- <-OOOO-G\n");
54  current=PrintBuffer(current,restlen, "G-OOOO-> Main Runnable Name: %s\n",fxMainName.Data());
55  current=PrintBuffer(current,restlen, "G-OOOO-> Watch Runnable Name: %s\n",fxWatchName.Data());
56  current=PrintBuffer(current,restlen, "G-OOOO-> Demo Histogram Name: %s\n",fxHistogramName.Data());
57  current=PrintBuffer(current,restlen, "G-OOOO-> ---------------------------------------------- <-OOOO-G\n");
58  Int_t delta=TGo4ClientStatus::PrintStatus(current,restlen); // gives us the superclass data
59  restlen-=delta;
60  current+=delta;
61  current=PrintBuffer(current,restlen, "G-OOOO-> END Example Client Status Class Printout END <-OOOO-G\n");
62  if(buffer==0)
63  {
64  std::cout << localbuf << std::endl;
65  }
66  else
67  {
68  size=locallen-restlen;
69  if(size>buflen-1) size=buflen-1;
70  strncpy(buffer,localbuf,size);
71  }
72  return size;
73 }
74 
76 {
77  GO4TRACE((12,"TGo4ExampleClientStatus::~TGo4ExampleClientStatus()",__LINE__, __FILE__));
78 }
int main(int argc, char **argv)
void SetHistoStatus(TH1 *histogram)
void SetNames(const char *main, const char *watch)
virtual Int_t PrintStatus(Text_t *buffer=0, Int_t buflen=0)
#define GO4TRACE(X)
Definition: TGo4Log.h:26
static Text_t * PrintBuffer(char *buffer, Int_t &buflen, const char *text,...)
Definition: TGo4Status.cxx:85
virtual Int_t PrintStatus(Text_t *buffer=0, Int_t buflen=0)