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

/Go4TaskHandlerExample/TGo4ExampleClientStatus.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 "TGo4ExampleClientStatus.h"
00017 
00018 #include <iostream.h>
00019 
00020 #include "Go4Log/TGo4Log.h"
00021 
00022 TGo4ExampleClientStatus::TGo4ExampleClientStatus(const char* name) : TGo4ClientStatus(name)
00023 {
00024   TRACE((12,"TGo4ExampleClientStatus::TGo4ExampleClientStatus(Text_t*)",__LINE__, __FILE__));
00025 }
00026 
00027 void TGo4ExampleClientStatus::SetHistoStatus(TH1* histogram)
00028 {
00029    TRACE((12,"TGo4ClientStatus::SetHistoStatus(TH1*)",__LINE__, __FILE__));
00030    fxHistogramName = histogram->GetName();
00031    // here the complete internal histogram information may be stored; we leave that
00032    // as an exercise for the reader!
00033 }
00034 
00035 void TGo4ExampleClientStatus::SetNames(const char* main, const char* watch)
00036 {
00037    TRACE((12,"TGo4ClientStatus::SetNames(Text_t*,...)",__LINE__, __FILE__));
00038    fxMainName = main;
00039    fxWatchName = watch;
00040 }
00041 
00042 Int_t TGo4ExampleClientStatus::PrintStatus(Text_t* buffer, Int_t buflen)
00043 {
00044    TRACE((12,"TGo4ExampleClientStatus::PrintStatus()",__LINE__, __FILE__));
00045    //
00046    if(buflen<=0 && buffer!=0)return 0;
00047    Int_t locallen=4096;
00048    Text_t localbuf[locallen];
00049    Text_t* current=localbuf;
00050    Int_t size=0;
00051    Int_t restlen=locallen;
00052    
00053    current=PrintBuffer(current,restlen, "G-OOOO->    ExampleClient Status Class %s Printout:  <-OOOO-G\n",GetName());
00054    current=PrintBuffer(current,restlen, "G-OOOO-> ---------------------------------------------- <-OOOO-G\n");
00055    current=PrintBuffer(current,restlen, "G-OOOO-> Main Runnable Name: %s\n",fxMainName.Data());
00056    current=PrintBuffer(current,restlen, "G-OOOO-> Watch Runnable Name: %s\n",fxWatchName.Data());
00057    current=PrintBuffer(current,restlen, "G-OOOO-> Demo Histogram Name: %s\n",fxHistogramName.Data());
00058    current=PrintBuffer(current,restlen, "G-OOOO-> ---------------------------------------------- <-OOOO-G\n");
00059    Int_t delta=TGo4ClientStatus::PrintStatus(current,restlen); // gives us the superclass data
00060    restlen-=delta;
00061    current+=delta;
00062    current=PrintBuffer(current,restlen, "G-OOOO-> END Example Client Status Class Printout END <-OOOO-G\n");
00063    if(buffer==0)
00064       {
00065          cout << localbuf << endl;
00066       }
00067    else
00068       {
00069          size=locallen-restlen;
00070          if(size>buflen-1) size=buflen-1;
00071          strncpy(buffer,localbuf,size);
00072       }
00073    return size;
00074 }
00075 
00076 TGo4ExampleClientStatus::~TGo4ExampleClientStatus()
00077 {
00078   TRACE((12,"TGo4ExampleClientStatus::~TGo4ExampleClientStatus()",__LINE__, __FILE__));
00079 }
00080 
00081 ClassImp(TGo4ExampleClientStatus)
00082 
00083 //----------------------------END OF GO4 SOURCE FILE ---------------------

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