GSI Object Oriented Online Offline (Go4)  GO4-6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4TaskHandlerStatus.cxx
Go to the documentation of this file.
1 // $Id: TGo4TaskHandlerStatus.cxx 2757 2020-04-16 11:45:21Z 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 "TGo4TaskHandlerStatus.h"
15 
16 #include <iostream>
17 
19  TGo4Status(),
20  fxComName(),
21  fxStatName(),
22  fxDatName(),
23  fxHostName(),
24  fuNegPort(0),
25  fiComPort(0),
26  fiStatPort(0),
27  fiDatPort(0),
28  fbIsAborting(kFALSE)
29 {
30 }
31 
33  TGo4Status(name),
34  fxComName(),
35  fxStatName(),
36  fxDatName(),
37  fxHostName(),
38  fuNegPort(0),
39  fiComPort(0),
40  fiStatPort(0),
41  fiDatPort(0),
42  fbIsAborting(kFALSE)
43 
44 {
45 }
46 
48 {
49 }
50 
51 Int_t TGo4TaskHandlerStatus::PrintStatus(Text_t* buffer, Int_t buflen)
52 {
53  if(buflen<=0 && buffer!=0)
54  return 0;
55  Int_t locallen=4096;
56  Text_t localbuf[4096];
57  Text_t* current=localbuf;
58  Int_t restlen=locallen;
59  Int_t size = 0;
60  current=PrintBuffer(current,restlen, "G-OOOO-> TaskHandler Status Class %s Printout: <-OOOO-G\n",GetName());
61  current=PrintBuffer(current,restlen, "G-OOOO-> --------------------------------------------------------------------- <-OOOO-G\n");
62  current=PrintBuffer(current,restlen, "G-OOOO-> Remote Server: %s\n",GetHostName());
63  current=PrintBuffer(current,restlen, "G-OOOO-> Negotiation Port: %d\n",fuNegPort);
64  current=PrintBuffer(current,restlen, "G-OOOO-> Command Thread: %s\n",GetComName());
65  current=PrintBuffer(current,restlen, "G-OOOO-> Command Port: %d\n",fiComPort);
66  current=PrintBuffer(current,restlen, "G-OOOO-> Data Thread: %s\n",GetDatName());
67  current=PrintBuffer(current,restlen, "G-OOOO-> Data Port: %d\n",fiDatPort);
68  current=PrintBuffer(current,restlen, "G-OOOO-> Status Thread: %s\n",GetStatName());
69  current = PrintBuffer(current, restlen, "G-OOOO-> Status Port: %d\n", fiStatPort);
70  if (fbIsAborting) {
71  current = PrintBuffer(current, restlen, "G-OOOO-> Aborting State: TRUE\n");
72  } else {
73  current = PrintBuffer(current, restlen, "G-OOOO-> Aborting State: FALSE\n");
74  }
75  current = PrintBuffer(current, restlen, "G-OOOO-> END TaskHandler Status Class Printout END <-OOOO-G\n");
76  if (buffer == 0) {
77  std::cout << localbuf << std::endl;
78  } else {
79  size = locallen - restlen;
80  if (size > buflen - 1)
81  size = buflen - 1;
82  strncpy(buffer, localbuf, size);
83  }
84  return size;
85 }
86 
87 void TGo4TaskHandlerStatus::SetFlags(Bool_t isaborting)
88 {
89  fbIsAborting=isaborting;
90 }
91 
92 void TGo4TaskHandlerStatus::SetPorts(UInt_t neg, Int_t com, Int_t stat, Int_t dat)
93 {
94  fuNegPort=neg;
95  fiComPort=com;
96  fiStatPort=stat;
97  fiDatPort=dat;
98 }
99 
100 void TGo4TaskHandlerStatus::SetNames(const char* com, const char* stat, const char* dat, const char* host)
101 {
102  fxComName = com;
103  fxStatName = stat;
104  fxDatName = dat;
105  fxHostName = host;
106 }
void SetPorts(UInt_t neg, Int_t com, Int_t stat, Int_t dat)
const char * GetDatName() const
const char * GetComName() const
virtual Int_t PrintStatus(Text_t *buffer=0, Int_t buflen=0)
const char * GetHostName() const
void SetFlags(Bool_t isaborting)
const char * GetStatName() const
static Text_t * PrintBuffer(char *buffer, Int_t &buflen, const char *text,...)
Definition: TGo4Status.cxx:84
void SetNames(const char *com, const char *stat, const char *dat, const char *host)