GSI Object Oriented Online Offline (Go4)  GO4-6.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4BranchStatus.cxx
Go to the documentation of this file.
1 // $Id: TGo4BranchStatus.cxx 2736 2020-04-15 16:11:19Z 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 "TGo4BranchStatus.h"
15 
16 #include <iostream>
17 #include "TGo4Log.h"
18 
19 #include "TBranchElement.h"
20 
23 {
24 }
25 
27  TGo4ObjectStatus(branch, kFALSE)
28 {
29  if (branch!=0)
30  {
31  if(branch->InheritsFrom(TBranchElement::Class()))
32  fxObjectClass = (dynamic_cast<TBranchElement*>(branch))->GetTypeName();
33  else
34  fxObjectClass = branch->GetClassName();
35  }
36  if (fxObjectClass.Length()==0)
37  fxObjectClass = branch ? branch->ClassName() : "BranchElement";
38 }
39 
41 {
42 }
43 
44 Int_t TGo4BranchStatus::PrintStatus(Text_t* buffer, Int_t buflen)
45 {
46  //return 0;
47  GO4TRACE((12,"TGo4BranchStatus::PrintStatus()",__LINE__, __FILE__));
48  if(buflen<=0 && buffer!=0)
49  return 0;
50  Int_t locallen=128000;
51  Text_t localbuf[128000];
52  Int_t size=0;
53  Text_t* current=localbuf;
54  Int_t restlen=locallen;
55  Int_t delta= TGo4ObjectStatus::PrintStatus(current,restlen);
56  restlen-=delta;
57  current+=delta;
58  current=PrintIndent(current,restlen);
59  current=PrintBuffer(current,restlen, "G-OOOO-> TreeBranch Status Class Printout <-OOOO-G\n");
60  current=PrintIndent(current,restlen);
61  current = PrintBuffer(current, restlen, "G-OOOO-> ---------------------------------------------- <-OOOO-G\n");
62  if (buffer == 0) {
63  std::cout << localbuf << std::endl;
64  } else {
65  size = locallen - restlen;
66  if (size > buflen - 1)
67  size = buflen - 1;
68  strncpy(buffer, localbuf, size);
69  }
70  return size;
71 }
virtual ~TGo4BranchStatus()
virtual Int_t PrintStatus(Text_t *buffer=0, Int_t buflen=0)
static Text_t * PrintIndent(Text_t *buffer, Int_t &buflen)
Definition: TGo4Status.cxx:72
#define GO4TRACE(X)
Definition: TGo4Log.h:26
virtual Int_t PrintStatus(Text_t *buffer=0, Int_t buflen=0)
static Text_t * PrintBuffer(char *buffer, Int_t &buflen, const char *text,...)
Definition: TGo4Status.cxx:84