Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "TGo4TaskStatus.h"
00015
00016 #include "Riostream.h"
00017
00018 #include "TGo4TaskHandlerStatus.h"
00019
00020 TGo4TaskStatus::TGo4TaskStatus() :
00021 TGo4Status(),
00022 fxTaskHandlerStatus(0)
00023 {
00024 }
00025
00026 TGo4TaskStatus::TGo4TaskStatus(const char* name) :
00027 TGo4Status(name),
00028 fxTaskHandlerStatus(0)
00029 {
00030 }
00031
00032 TGo4TaskStatus::~TGo4TaskStatus()
00033 {
00034 delete fxTaskHandlerStatus;
00035 fxTaskHandlerStatus = 0;
00036 }
00037
00038 void TGo4TaskStatus::SetFlags(Bool_t blocking,
00039 Bool_t autocreate,
00040 Bool_t autostart,
00041 Bool_t terminating,
00042 Bool_t initdone)
00043 {
00044 fbAppBlocking=blocking;
00045 fbAutoCreate=autocreate;
00046 fbAutoStart=autostart;
00047 fbTerminating=terminating;
00048 fbInitDone=initdone;
00049 }
00050 void TGo4TaskStatus::SetTaskHandlerStatus(TGo4TaskHandlerStatus* thstate)
00051 {
00052 fxTaskHandlerStatus = thstate;
00053 }
00054
00055 Int_t TGo4TaskStatus::PrintStatus(Text_t* buffer, Int_t buflen)
00056 {
00057
00058 if(buflen<=0 && buffer!=0) return 0;
00059
00060 Int_t locallen=4096;
00061 Text_t localbuf[4096];
00062 Text_t* current=localbuf;
00063 Int_t size=0;
00064 Int_t restlen=locallen;
00065 current=PrintBuffer(current,restlen, "G-OOOO-> Client Status Class %s Printout: <-OOOO-G\n",GetName());
00066 current=PrintBuffer(current,restlen, "G-OOOO-> ---------------------------------------------- <-OOOO-G\n");
00067 current=PrintBuffer(current,restlen, "G-OOOO-> Blockingmode: %d\n",fbAppBlocking);
00068 current=PrintBuffer(current,restlen, "G-OOOO-> Autocreate: %d\n",fbAutoCreate);
00069 current=PrintBuffer(current,restlen, "G-OOOO-> Autostart: %d\n",fbAutoStart);
00070 current=PrintBuffer(current,restlen, "G-OOOO-> InitDone: %d\n",fbInitDone);
00071 current=PrintBuffer(current,restlen, "G-OOOO-> IsTerminating: %d\n",fbTerminating);
00072 current=PrintBuffer(current,restlen, "G-OOOO-> ---------------------------------------------- <-OOOO-G\n");
00073 Int_t delta=fxTaskHandlerStatus->PrintStatus(current,restlen);
00074 restlen-=delta;
00075 current+= delta;
00076 current=PrintBuffer(current,restlen, "G-OOOO-> END Client Status Class Printout END <-OOOO-G\n");
00077 if(buffer==0)
00078 {
00079 std::cout << localbuf << std::endl;
00080 }
00081 else
00082 {
00083 size=locallen-restlen;
00084 if(size>buflen-1)
00085 size=buflen-1;
00086 strncpy(buffer,localbuf,size);
00087 }
00088 return size;
00089 }