Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

TGo4BranchStatus.cxx

Go to the documentation of this file.
00001 //-------------------------------------------------------------
00002 //        Go4 Release Package v3.04-01 (build 30401)
00003 //                      28-November-2008
00004 //---------------------------------------------------------------
00005 //   The GSI Online Offline Object Oriented (Go4) Project
00006 //   Experiment Data Processing at EE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
00015 //----------------------------------------------------------------
00016 #include "TGo4BranchStatus.h"
00017 
00018 #include "Riostream.h"
00019 
00020 #include "TGo4Log.h"
00021 
00022 #include "TBranch.h"
00023 #include "TBranchElement.h"
00024 
00025 TGo4BranchStatus::TGo4BranchStatus() :
00026    TGo4ObjectStatus()
00027 {
00028 }
00029 
00030 TGo4BranchStatus::TGo4BranchStatus(TBranch* branch) :
00031    TGo4ObjectStatus(branch, kFALSE)
00032 {
00033    if (branch!=0)
00034       {
00035          if(branch->InheritsFrom(TBranchElement::Class()))
00036             fxObjectClass = (dynamic_cast<TBranchElement*>(branch))->GetTypeName();
00037          else
00038             fxObjectClass = branch->GetClassName();
00039       }
00040    if (fxObjectClass.Length()==0)
00041      fxObjectClass = branch ? branch->ClassName() : "BranchElement";
00042 }
00043 
00044 TGo4BranchStatus::~TGo4BranchStatus()
00045 {
00046 }
00047 
00048 Int_t TGo4BranchStatus::PrintStatus(Text_t* buffer, Int_t buflen)
00049 {
00050    //return 0;
00051    TRACE((12,"TGo4BranchStatus::PrintStatus()",__LINE__, __FILE__));
00052    if(buflen<=0 && buffer!=0)
00053       return 0;
00054    Int_t locallen=128000;
00055    Text_t localbuf[128000];
00056    Int_t size=0;
00057    Text_t* current=localbuf;
00058    Int_t restlen=locallen;
00059    Int_t delta= TGo4ObjectStatus::PrintStatus(current,restlen);
00060    restlen-=delta;
00061    current+=delta;
00062    current=PrintIndent(current,restlen);
00063    current=PrintBuffer(current,restlen, "G-OOOO-> TreeBranch Status Class Printout <-OOOO-G\n");
00064    current=PrintIndent(current,restlen);
00065    current=PrintBuffer(current,restlen, "G-OOOO-> ---------------------------------------------- <-OOOO-G\n");
00066   if(buffer==0)
00067       {
00068           cout << localbuf << endl;
00069       }
00070    else
00071       {
00072          size=locallen-restlen;
00073          if(size>buflen-1)
00074                size=buflen-1;
00075          strncpy(buffer,localbuf,size);
00076       }
00077    return size;
00078 }
00079 
00080 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Fri Nov 28 12:59:28 2008 for Go4-v3.04-1 by  doxygen 1.4.2