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