Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/Go4StatusBase/TGo4BranchStatus.cxx

Go to the documentation of this file.
00001 //---------------------------------------------------------------
00002 //        Go4 Release Package v2.10-5 (build 21005) 
00003 //                      03-Nov-2005
00004 //---------------------------------------------------------------
00005 //       The GSI Online Offline Object Oriented (Go4) Project
00006 //       Experiment Data Processing at DVEE 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 <iostream.h>
00019 
00020 #include "Go4Log/TGo4Log.h"
00021 #include "TBranchElement.h"
00022 #include "TBranchObject.h"
00023 
00024 TGo4BranchStatus::TGo4BranchStatus(TBranch* branch) :
00025       TGo4ObjectStatus(branch, kFALSE) {
00026 // very old code
00027 
00028 //     fxObjectClass=branch->GetClassName();
00029 //      cout <<"******** branchname: "<<branch->GetName() << endl;
00030 //      cout <<"******** branchtitle: "<<branch->GetTitle() << endl;
00031 //      cout <<"******** branchclassname: "<<branch->GetClassName() << endl;
00032 //      cout <<"******** branchclass: "<<branch->ClassName() << endl;
00033 //      if(branch->InheritsFrom("TBranchElement"))
00034 //         {
00035 //            fxObjectClass=(dynamic_cast<TBranchElement*>(branch))->GetClassName();
00036 //         }
00037 //      else if(branch->InheritsFrom("TBranchObject"))
00038 //         {
00039 //            fxObjectClass=(dynamic_cast<TBranchObject*>(branch))->GetClassName();
00040 //         }
00041 //      else
00042 //         {
00043 //            cout <<"******** plain branch!!!!!" << endl;
00044 //         }
00045 
00046 // old code
00047 // if(branch) SetTitle(branch->GetClassName());
00048 
00049    if (branch)
00050       if(branch->InheritsFrom(TBranchElement::Class()))
00051          fxObjectClass = (dynamic_cast<TBranchElement*>(branch))->GetTypeName();
00052       else
00053          fxObjectClass = branch->GetClassName();
00054 
00055    if (fxObjectClass.Length()==0)
00056      fxObjectClass = branch ? branch->ClassName() : "BranchElement";
00057 }
00058 
00059 TGo4BranchStatus::~TGo4BranchStatus() {
00060 }
00061 
00062 Int_t TGo4BranchStatus::PrintStatus(Text_t* buffer, Int_t buflen)
00063 {
00064    //return 0;
00065    TRACE((12,"TGo4BranchStatus::PrintStatus()",__LINE__, __FILE__));
00066    if(buflen<=0 && buffer!=0)
00067       return 0;
00068    Int_t locallen=128000;
00069    Text_t localbuf[locallen];
00070    Int_t size=0;
00071    Text_t* current=localbuf;
00072    Int_t restlen=locallen;
00073    Int_t delta= TGo4ObjectStatus::PrintStatus(current,restlen);
00074    restlen-=delta;
00075    current+=delta;   
00076    current=PrintIndent(current,restlen);
00077    current=PrintBuffer(current,restlen, "G-OOOO-> TreeBranch Status Class Printout <-OOOO-G\n");
00078    current=PrintIndent(current,restlen);
00079    current=PrintBuffer(current,restlen, "G-OOOO-> ---------------------------------------------- <-OOOO-G\n");
00080   if(buffer==0)
00081       {
00082           cout << localbuf << endl;
00083       }
00084    else
00085       {
00086          size=locallen-restlen;
00087          if(size>buflen-1)
00088                size=buflen-1;
00089          strncpy(buffer,localbuf,size);
00090       }
00091    return size;
00092 
00093 }
00094 
00095 ClassImp(TGo4BranchStatus)
00096 
00097 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Tue Nov 8 10:56:05 2005 for Go4-v2.10-5 by doxygen1.2.15