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

/Go4StatusBase/TGo4MemberStatus.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 "TGo4MemberStatus.h"
00017 
00018 #include <iostream.h>
00019 
00020 #include "TDataMember.h"
00021 
00022 #include "Go4Log/TGo4Log.h"
00023 
00024 TGo4MemberStatus::TGo4MemberStatus(TDataMember* mem) : 
00025    TGo4ObjectStatus(0,kFALSE)
00026 {
00027 if(mem)
00028    {
00029       Text_t buffer[256];
00030       SetTitle(mem->GetFullTypeName());
00031       SetName(mem->GetName());
00032       fxObjectClass=mem->GetFullTypeName();
00033 
00034       // evaluate dimension and ranges of array members:
00035       Int_t arraydim=mem->GetArrayDim();
00036       Int_t maxindex, maxindey;
00037       switch(arraydim)
00038          {
00039             case 1:
00040               maxindex=mem->GetMaxIndex(0);
00041               snprintf(buffer,256,"%s[%d]",GetName(),maxindex);
00042               SetName(buffer);
00043               break;
00044 
00045             case 2:
00046               maxindex=mem->GetMaxIndex(0);
00047               maxindey=mem->GetMaxIndex(1);
00048               snprintf(buffer,256,"%s[%d][%d]",
00049                  GetName(),maxindex,maxindey);
00050               SetName(buffer);
00051               break;
00052 
00053             default:
00054               // use existing name without modifications
00055               SetName(mem->GetName());
00056               break;
00057          } // switch()
00058 
00059 
00060    }
00061 else
00062    {
00063    }
00064 }
00065 
00066 TGo4MemberStatus::~TGo4MemberStatus()
00067 { }
00068 
00069 Int_t TGo4MemberStatus::PrintStatus(Text_t* buffer, Int_t buflen)
00070 {
00071    //return 0;
00072    TRACE((12,"TGo4MemberStatus::PrintStatus()",__LINE__, __FILE__));
00073    if(buflen<=0 && buffer!=0)
00074       return 0;
00075    Int_t locallen=128000;
00076    Text_t localbuf[locallen];
00077    Int_t size=0;
00078    Text_t* current=localbuf;
00079    Int_t restlen=locallen;
00080    Int_t delta   = TGo4ObjectStatus::PrintStatus(current,restlen);
00081    restlen-=delta;
00082    current+=delta;
00083    current=PrintIndent(current,restlen);
00084    current=PrintBuffer(current,restlen, "G-OOOO-> Datamember Status Class Printout <-OOOO-G\n");
00085    current=PrintIndent(current,restlen);
00086    current=PrintBuffer(current,restlen, "G-OOOO-> ---------------------------------------------- <-OOOO-G\n");
00087   if(buffer==0)
00088       {
00089           cout << localbuf << endl;
00090       }
00091    else
00092       {
00093          if(size>buflen-1)
00094                size=buflen-1;
00095          strncpy(buffer,localbuf,size);
00096       }
00097    return size;
00098 }
00099 
00100 ClassImp(TGo4MemberStatus)
00101 
00102 //----------------------------END OF GO4 SOURCE FILE ---------------------

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