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