GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4Task.cxx
Go to the documentation of this file.
1 // $Id: TGo4Task.cxx 1457 2015-05-28 14:59:14Z linev $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #include "TGo4Task.h"
15 
16 #include "TFile.h"
17 #include "TMutex.h"
18 #include "TROOT.h"
19 #include "snprintf.h"
20 
21 #include "TGo4Log.h"
22 #include "TGo4Buffer.h"
23 #include "TGo4LockGuard.h"
24 #include "TGo4CommandInvoker.h"
25 #include "TGo4RemoteCommand.h"
27 #include "TGo4ObjectQueue.h"
28 #include "TGo4BufferQueue.h"
29 #include "TGo4ThreadHandler.h"
30 #include "TGo4TaskStatus.h"
31 #include "TGo4TaskHandler.h"
33 #include "TGo4Master.h"
34 #include "TGo4Slave.h"
35 
36 const Int_t TGo4Task::fgiTERMID=999;
37 
38 TGo4Task::TGo4Task(const char* name, Bool_t blockingmode,
39  Bool_t autostart,
40  Bool_t autocreate,
41  Bool_t ismaster) :
42  TGo4ThreadManager(name,blockingmode, autostart,autocreate),
43  fbCommandMaster(ismaster), fxMaster(0), fxSlave(0),fxOwner(0),
44  fbWorkIsStopped(kFALSE),fxStopBuffer(0),fxQuitBuffer(0)
45 {
47  fxStatusBuffer= new TGo4Buffer(TBuffer::kWrite);
48  fxStatusMutex= new TMutex(kTRUE);
52 
53  TGo4CommandInvoker::Instance(); // make sure we have an invoker instance!
55 
56  TGo4CommandInvoker::Register("NoReceiver", this); // for simple command test
57  TGo4CommandInvoker::Register("Task",this); // register as command receiver at the global invoker
58 
59 
60  // local command queue:
61  fxLocalCommandQueue = new TGo4ObjectQueue("localcommands");
62 
63  // local command runnable:
64  TString nomen("LocalCommandRunnable of "); nomen+=name;
65  TGo4LocalCommandRunnable* commander = new TGo4LocalCommandRunnable(nomen.Data(), this);
66 
67  fxCommanderName = "COMMANDER-"; fxCommanderName += name;
68  GetWorkHandler()->NewThread(GetCommanderName(), commander);
69 }
70 
72 {
73  if(fxOwner) {
74  fxOwner->SetTask(0,kFALSE); // on termination from threadmanager, we take over responsibility for cleanup
75  delete fxOwner;
76  }
77  delete fxLocalCommandQueue;
78  delete fxCommandPrototype;
79  delete fxQuitBuffer;
80  delete fxStopBuffer;
81  delete fxStatusBuffer;
82  delete fxStatusMutex;
84 }
85 
87 {
88  if(m!=0) SetMaster(kTRUE);
89  fxMaster=m;
90 }
91 
93 {
94  if(s!=0) SetMaster(kFALSE);
95  fxSlave=s;
96 }
97 
99 {
100  fxOwner=owner;
101  SetMaster(dynamic_cast<TGo4Master*>(owner));
102  SetSlave(dynamic_cast<TGo4Slave*>(owner));
103 }
104 
106 {
107  if(fxSlave) fxSlave->Start();
108 }
109 
111 {
112  if(fxSlave) fxSlave->Stop();
113 }
114 
116 {
117  if(fxSlave) fxSlave->Quit();
118 }
119 
121 {
122  if(fxSlave) fxSlave->KillMain();
123 
124 }
126 {
127  if(fxSlave) fxSlave->RestartMain();
128 }
129 
130 void TGo4Task::Terminate (Bool_t termapp)
131 {
132  if(fxSlave)
133  fxSlave->Terminate(termapp);
134  else
136 }
137 
139 {
140  if(fxSlave)
142  else
144 }
145 
146 void TGo4Task::ExecuteString(const char* command)
147 {
148  if(fxSlave)
149  fxSlave->ExecuteString(command);
150  else
151  gROOT->ProcessLineSync(command);
152 }
153 
155 {
156  return 0;
157 }
158 
160 {
161  return 0; // please override
162 }
163 
165 {
166  return 0; // please override
167 }
169 {
170  return 0; // please override
171 }
172 
174 {
175  // keep this method for compatibility reasons, user should not need access to list
176  return fxCommandPrototype;
177 }
178 
180 {
181  if(!IsMaster()) return 0;
182  TObject* obj=0;
183  TGo4Status* stat=0;
184  TGo4BufferQueue* statqueue = dynamic_cast<TGo4BufferQueue*> (GetStatusQueue());
185  if(statqueue)
186  {
187  // polling mode for timer: we do not go into condition wait!
188  if(!wait && statqueue->IsEmpty()) return 0;
189  obj = statqueue->WaitObjectFromBuffer();
190  if(obj)
191  {
192  if(obj->InheritsFrom(TGo4Status::Class()))
193  {
194  stat= dynamic_cast<TGo4Status*>(obj);
195  }
196  else
197  {
198  TGo4Log::Debug(" !!! Master Task: NextStatus ERROR, unknown object %s from status queue!!! ",
199  obj->GetName());
200  delete obj;
201  }
202  }
203  else
204  {
205  TGo4Log::Debug(" !!! Master Task NextStatus ERROR -- NULL object from data queue!!! ");
206  } // if(obj)
207  }
208  else //if(statqueue)
209  {
210  //TGo4Log::Debug(" !!! Master Task NextStatus ERROR -- no data queue!!! ");
211  stat=0;
212  }
213  return stat;
214 }
215 
216 
217 TObject * TGo4Task::NextObject(Bool_t wait)
218 {
219  if(!IsMaster()) return 0;
220  TObject* obj=0;
221  TGo4BufferQueue* dataqueue=dynamic_cast<TGo4BufferQueue*> (GetDataQueue());
222  if(dataqueue)
223  {
224  if(!wait && dataqueue->IsEmpty())
225  return 0; // polling mode for timer: we do not go into condition wait!
226  obj=dataqueue->WaitObjectFromBuffer(); // wait for buffer and stream object
227 
228  }
229  else //if(dataqueue)
230  {
231  //TGo4Log::Debug(" !!! Master Task NextObject ERROR -- no data queue!!! ");
232  obj=0;
233  }
234  return obj;
235 }
236 
238 {
240 }
241 
243 {
244  if(comlist)
245  {
246  *fxCommandPrototype += *comlist;
247  // operator+= of TGo4CommandProtolist puts new commands into old list
248  delete comlist;
249  comlist=0;
250  }
251 }
252 
253 void TGo4Task::SendObject(TObject * obj, const char* receiver)
254 {
255  if(IsMaster()) return;
256  if(obj) {
257  // object exists, put it into data queue
258  TGo4BufferQueue * dataq=GetDataQueue(receiver);
259  if(dataq)
260  {
261  // TGo4Log::Debug(" Task - sending object: %s ",obj->GetName());
262  //SendStatusMessage(1, kTRUE,"Task - sending object: %s ",obj->GetName());
263  dataq->AddBufferFromObject(obj);
264  }
265  else
266  {
267  TGo4Log::Debug(" !!! Task - ERROR sending object - no data queue !!! ");
268  }
269  }
270  else
271  {
272  // object not found, send error message through status
273  SendStatusMessage(2, kTRUE, "Task - object not found");
274  }
275 }
276 
277 void TGo4Task::SendStatus(TGo4Status * stat, const char* receiver)
278 {
279  if(IsMaster()) return;
280  if(stat) {
281  // object exists, put it into status queue
282  TGo4BufferQueue * statq=GetStatusQueue(receiver);
283  if(statq) {
284  TGo4Log::Debug(" Task - sending status %s ", stat->ClassName());
285  statq->AddBufferFromObject(stat);
286  } else {
287  TGo4Log::Debug(" !!! Task - ERROR sending status: no status queue !!! ");
288  }
289  } else {
290  // TGo4Log::Debug(" !!! Task - ERROR sending status: no such object!!! ");
291  }
292 }
293 
295 {
296  if(IsMaster()) return;
297  TGo4LockGuard statguard(fxStatusMutex); // do not send during buffer update
298  TGo4Log::Debug(" Task - sending status buffer ");
300  if(statq) statq->AddBuffer(fxStatusBuffer,kTRUE);
301 }
302 
303 void TGo4Task::SendStatusMessage(Int_t level, Bool_t printout, const char* text,...)
304 {
305  if(IsMaster()) return;
306  Int_t lbuflen=256;
307  // put potential printf arguments in text:
308  char txtbuf[256];
309  va_list args;
310  va_start(args, text);
311  vsnprintf(txtbuf, lbuflen, text, args);
312  va_end(args);
313  // figure out here possible destination for message in string:
314  const char* dest;
315  char* curs=txtbuf;
316  TString receiver=txtbuf;
317  Ssiz_t pos=receiver.Index("::",2,0,TString::kExact);
318  if(pos!=kNPOS) {
319  // before this we have receiver:
320  receiver.Resize(pos);
321  dest=receiver.Data();
322  curs += ((size_t) pos);
323  curs +=2; // skip separator
324  } else {
325  dest = 0;
326  }
327  //std::cout <<"SSSSSSendStatusMessage has receiver "<<dest <<" and message "<<curs << std::endl;
328  Bool_t previousmode = TGo4Log::IsOutputEnabled();
329  TGo4Log::OutputEnable(printout); // override the messaging state
330  const char* go4mess = TGo4Log::Message(level, curs);
331  TGo4Log::OutputEnable(previousmode); // restore old state of messaging
332  if((level>0) && (go4mess!=0)) {
333  // do not send debug-level output to gui, and do not send suppressed messages as empty string!
334  TGo4Status* message = new TGo4Status(go4mess);
335  SendStatus(message, dest);
336  delete message;
337  }
338 }
339 
341 {
342  if(IsMaster()) return;
343  TGo4LockGuard statguard(fxStatusMutex); // do not update during sending
344  TGo4LockGuard main; // protect root streaming
345  TFile *filsav = gFile;
346  gFile = 0;
347 
349 
350  fxStatusBuffer->Reset();
351  fxStatusBuffer->InitMap();
352  fxStatusBuffer->WriteObject(state);
353  gFile = filsav;
354  delete state; // avoid memory leak!!
355 }
356 
358 {
359  if(IsMaster()) return 0;
360  TGo4Command* com=0;
361  TGo4BufferQueue * comq = GetCommandQueue();
362  if(comq==0) return 0;
363  if(!comq->IsEmpty() || (fxSlave!=0 && !fxSlave->MainIsRunning() ) )
364  {
365  // put new command out of queue
366  // or wait for command if analysis is stopped
367  TObject* obj = comq->WaitObjectFromBuffer();
368  if(obj)
369  {
370  if(obj->InheritsFrom(TGo4Command::Class()))
371  {
372  com = dynamic_cast<TGo4Command*>(obj);
373  com->SetTaskName("current");
375  }
376  else
377  {
378  delete obj;
379  }
380  }
381  else
382  {
383  //TGo4Log::Debug(" !!! Slave ERROR -- NULL object from command queue!!! ");
384  }
385  }
386  else //if(!fxCommandQ->IsEmpty() || !AnalysisIsRunning())
387  {
388  com=0;
389  }
390  return com;
391 }
392 
394 {
395  // this method will be called by the application control timer every timerperiod
396  Int_t rev=-1;
397  if(fbInitDone)
398  // already initialized
399  {
400  rev=0;
401  }
402  else
403  {
404  if(fxCommandPrototype==0)
405  {
406  if(fxMaster)
407  {
408  fxCommandPrototype=fxMaster->CreateCommandList(); // use factory method
409  TGo4Log::Debug(" Task -- command list is created from Master factory");
410  }
411  else
412  {
414  TGo4Log::Debug(" Task -- command list is created from Task factory");
415  }
416  }
417  rev=TGo4ThreadManager::Initialization(); // this will launch threads, etc.
418  fxWorkHandler->Start(GetCommanderName()); // for non autostart mode
420  }// else if(fbInitDone)
421  return rev;
422 }
423 
425 {
426  TGo4TaskHandlerStatus* taskhandlerstatus=0;
428  if(th) taskhandlerstatus=th->CreateStatus();
429  state->SetTaskHandlerStatus(taskhandlerstatus);
431 }
432 
434 {
435  TGo4TaskStatus* stat = new TGo4TaskStatus(GetName());
436  UpdateStatus(stat); // set the internals
437  return stat;
438 }
439 
440 Bool_t TGo4Task::SubmitCommand(const char* name)
441 {
442  if(!strcmp(name,"THEMQuit"))
443  {
445  }
446  else if (!strcmp(name,"THEMKill"))
447  {
449  }
450  else if (!strcmp(name,"THEMRestart"))
451  {
453  }
454  else
455  {
456  // TGo4Command* com=0;
457  TGo4Command* com = MakeCommand(name);
458  if(com==0) // only encapsulate commands that are not known here
459  {
460  // try simple command with remote command envelope:
461  TGo4LockGuard mainlock;
462  com = new TGo4RemoteCommand(name);
463  //std::cout <<"submitted remote command of "<<name << std::endl;
464  }
465  return (SubmitCommand(com)) ;
466  }
467 }
468 
470 {
471  TGo4BufferQueue* queue = GetCommandQueue();
472  if(queue!=0)
473  {
474  // we have an active command queue...
475  if(val==kComQuit)
476  {
477  // quit command might be send from thread. use preallocated buffer!
478  queue->AddBuffer(fxQuitBuffer,kTRUE);
479  }
480  else
481  {
482  TBuffer* commandbuffer = TGo4BufferQueue::CreateValueBuffer((UInt_t) val);
483  queue->AddBuffer(commandbuffer); // put command into queue
484  }
485 
486  return kTRUE;
487  }
488  return kFALSE;
489 }
490 
491 Bool_t TGo4Task::SubmitEmergencyData(Go4EmergencyCommand_t val, const char* receiver)
492 {
493  TGo4BufferQueue* queue=GetDataQueue(receiver);
494  if(queue!=0)
495  {
496  // we have an active data queue...
497  if(val==kComQuit)
498  {
499  // quit data is send from thread. use preallocated buffer!
500  queue->AddBuffer(fxQuitBuffer,kTRUE);
501  }
502  else
503  {
504  TBuffer* commandbuffer=TGo4BufferQueue::CreateValueBuffer((UInt_t) val);
505  queue->AddBuffer(commandbuffer); // put command into queue
506  //std::cout <<"UUUUUUUU SubmitEmergencyData to "<<receiver << std::endl;
507  }
508  return kTRUE;
509  }
510  return kFALSE;
511 }
512 
514 {
515  if (com==0) return kFALSE;
516 
517  Bool_t rev=kTRUE;
518  if(com->IsLocal())
519  SubmitLocalCommand(com);
520  else {
521  // command for remote client, put into actual client queue
523  if(queue!=0) {
524  // we have an active command queue...
525  TGo4LockGuard mainlock; // protect the streamer!
526  //std::cout << "Mainlock acquired by server task: SubmitCommand"<< std::endl;
527  queue->AddBufferFromObject(com); // put command into queue
528  } else
529  rev = kFALSE;
530  delete com; // buffer queue does not adopt com, we delete it
531  }
532  return rev;
533 }
534 
536 {
537  return (new TGo4TaskHandlerCommandList("Go4ServerTaskDefaultCommandList") );
538 }
539 
541 {
542  TGo4LockGuard mainlock;
543  return ( fxCommandPrototype->MakeCommand(name) );
544 }
545 
547 {
548  if(com==0) return kFALSE;
549  com->SetMode(kGo4ComModeAdministrator); // everything is allowed here...
550  fxWorkHandler->Start(GetCommanderName()); // for non autostart mode
552  if(lqueue==0) {
553  delete com;
554  return kFALSE;
555  }
556  lqueue->AddObject(com); // object queue adopts command
557  return kTRUE;
558 }
559 
561 {
562  if(GetTaskHandler() && GetTaskHandler()->IsAborting())
563  {
564  //std::cout <<"Do not WakeCommandQueue() when aborting taskhandler" << std::endl;
565  return;
566  }
567  // put dummy buffer to command queue. This will wake up the main thread from command wait.
568  TGo4Command* com=new TGo4Command("dummy","this wakes up queue",id);
569  SubmitCommand(com); // wake up main command queue (to taskhandler)
570  com=new TGo4Command("dummy","this wakes up queue",id);
571  SubmitLocalCommand(com); // wake up local command queue
572 
573  // note: command is owned by submit command after submit!
574 }
575 
577 {
578  TGo4Log::Debug(" Task ''%s'' Send Status to Command Master ",GetName());
579  TGo4BufferQueue* queue = GetStatusQueue();
580  if(queue==0) return;
581  {
582  TGo4LockGuard mainguard;
583  // std::cout << "Mainlock acquired by clienttask: GetStatus"<< std::endl;
584  TGo4TaskStatus* state=CreateStatus();
585  queue->AddBufferFromObject(state);
586  }
587 }
588 
590 {
591  fbWorkIsStopped = kFALSE;
592  return fxOwner ? fxOwner->StartWorkThreads() : 0;
593 }
594 
596 {
597  fbWorkIsStopped=kTRUE;
598  return fxOwner ? fxOwner->StopWorkThreads() : 0;
599 }
600 
601 void TGo4Task::SendStopBuffers(const char* taskname)
602 {
604  if(th==0) return;
605  if(th->IsAborting()) {
606  //std::cout <<"Do not SendStopBuffers() when aborting taskhandler" << std::endl;
607  return;
608  }
609 
610  if(IsMaster())
611  {
612  //std::cout <<"SSSSSSSSs SendStopBuffers() as master" << std::endl;
613  TGo4BufferQueue * comq=GetCommandQueue(taskname);
614  if(comq)
615  {
616  comq->AddBuffer(fxStopBuffer,kTRUE);
617  }
618  }
619  else
620  {
621  //std::cout <<"SSSSSSSSs SendStopBuffers() as slave, sending to "<<taskname << std::endl;
622  TGo4BufferQueue * dataq=GetDataQueue(taskname);
623  if(dataq)
624  {
625  dataq->AddBuffer(fxStopBuffer,kTRUE);
626  }
627  TGo4BufferQueue * statq=GetStatusQueue(taskname);
628  if(statq)
629  {
630  statq->AddBuffer(fxStopBuffer,kTRUE);
631  }
632  }//if(IsMaster())
633 }
634 
636 {
637  return fgiTERMID;
638 }
639 
virtual void UpdateStatus(TGo4TaskStatus *state)
Definition: TGo4Task.cxx:424
virtual Int_t Initialization()
virtual Int_t Initialization()
Definition: TGo4Slave.cxx:132
virtual void ExecuteString(const char *command)
Definition: TGo4Task.cxx:146
Go4EmergencyCommand_t
virtual void Terminate(Bool_t termapp=kTRUE)
Definition: TGo4Slave.cxx:90
virtual Int_t StartWorkThreads()
Definition: TGo4Task.cxx:589
const char * GetCommanderName() const
Definition: TGo4Task.h:252
virtual void TerminateFast()
TBuffer * fxAbortBuffer
Definition: TGo4Task.h:341
void AddObject(TObject *object, Bool_t clone=kFALSE)
TGo4Command * MakeCommand(const char *name)
Definition: TGo4Task.cxx:540
virtual void Stop()
Definition: TGo4Task.cxx:110
Bool_t SubmitLocalCommand(TGo4Command *com)
Definition: TGo4Task.cxx:546
TGo4Master * fxMaster
Definition: TGo4Task.h:322
virtual TGo4TaskStatus * CreateStatus()
Definition: TGo4Slave.cxx:102
TObject * WaitObjectFromBuffer()
void WakeCommandQueue(Int_t id=0)
Definition: TGo4Task.cxx:560
void SetSlave(TGo4Slave *s)
Definition: TGo4Task.cxx:92
virtual Int_t Initialization()
Definition: TGo4Task.cxx:393
static void SetCommandList(TGo4CommandProtoList *list)
static void UnRegister(TGo4CommandReceiver *p)
virtual ~TGo4Task()
Definition: TGo4Task.cxx:71
friend class TGo4LocalCommandRunnable
Definition: TGo4Task.h:39
virtual TGo4Command * NextCommand()
Definition: TGo4Task.cxx:357
TGo4ThreadHandler * fxWorkHandler
void SetTaskName(const char *)
virtual void TerminateFast()
Definition: TGo4Slave.cxx:96
TGo4TaskOwner * fxOwner
Definition: TGo4Task.h:328
TGo4ObjectQueue * fxLocalCommandQueue
Definition: TGo4Task.h:311
TGo4TaskHandlerCommandList * fxCommandPrototype
Definition: TGo4Task.h:308
Bool_t IsAborting() const
TBuffer * fxStopBuffer
Definition: TGo4Task.h:335
Bool_t MainIsRunning()
Definition: TGo4Slave.h:92
TBuffer * fxQuitBuffer
Definition: TGo4Task.h:338
static Bool_t IsOutputEnabled()
Definition: TGo4Log.cxx:364
TGo4ObjectQueue * GetLocalCommandQueue()
Definition: TGo4Task.h:289
virtual TGo4TaskHandler * GetTaskHandler()
Definition: TGo4Task.cxx:154
static void Register(const char *name, TGo4CommandReceiver *p)
void SendStopBuffers(const char *taskname=0)
Definition: TGo4Task.cxx:601
static void OutputEnable(Bool_t on=kTRUE)
Definition: TGo4Log.cxx:358
virtual void RestartMain()
Definition: TGo4Task.cxx:125
TGo4Slave * fxSlave
Definition: TGo4Task.h:325
Bool_t NewThread(const char *name, TGo4Runnable *runnable)
virtual void Quit()
virtual TGo4TaskHandlerCommandList * CreateCommandList()
Definition: TGo4Master.cxx:59
virtual void ExecuteString(const char *command)
Definition: TGo4Slave.cxx:162
virtual Int_t StopWorkThreads()
Definition: TGo4Task.cxx:595
int main(int argc, char **argv)
static const Int_t fgiTERMID
Definition: TGo4Task.h:344
virtual Int_t StopWorkThreads()
virtual void Start()
Definition: TGo4Slave.cxx:67
virtual void TerminateFast()
Definition: TGo4Task.cxx:138
virtual void Stop()
Definition: TGo4Slave.cxx:74
void SetTaskHandlerStatus(TGo4TaskHandlerStatus *thstate)
virtual void SendStatusBuffer()
Definition: TGo4Task.cxx:294
Bool_t IsEmpty()
Definition: TGo4Queue.cxx:88
virtual void GetStatus()
Definition: TGo4Task.cxx:576
virtual TGo4BufferQueue * GetDataQueue(const char *task=0)
Definition: TGo4Task.cxx:168
void SendObject(TObject *obj, const char *receiver=0)
Definition: TGo4Task.cxx:253
virtual void SendStatus(TGo4Status *stat, const char *receiver=0)
Definition: TGo4Task.cxx:277
Bool_t SubmitCommand(const char *name)
Definition: TGo4Task.cxx:440
static TGo4CommandInvoker * Instance()
virtual TGo4BufferQueue * GetCommandQueue(const char *task=0)
Definition: TGo4Task.cxx:159
Bool_t fbWorkIsStopped
Definition: TGo4Task.h:331
TGo4ThreadHandler * GetWorkHandler() const
TMutex * fxStatusMutex
Definition: TGo4Task.h:296
Bool_t SubmitEmergencyCommand(Go4EmergencyCommand_t val)
Definition: TGo4Task.cxx:469
void AddBuffer(TBuffer *buffer, Bool_t clone=kFALSE)
void SetOwner(TGo4TaskOwner *owner)
Definition: TGo4Task.cxx:98
static const char * Message(Int_t prio, const char *text,...)
Definition: TGo4Log.cxx:209
void AddUserCommandList(TGo4CommandProtoList *comlist)
Definition: TGo4Task.cxx:242
virtual TGo4TaskHandlerCommandList * CreateCommandList()
Definition: TGo4Task.cxx:535
Bool_t Start(const char *thname)
TGo4Task(const char *name, Bool_t blockingmode, Bool_t autostart=kFALSE, Bool_t autocreate=kTRUE, Bool_t ismaster=kFALSE)
Definition: TGo4Task.cxx:38
TString fxCommanderName
Definition: TGo4Task.h:319
TBuffer * fxStatusBuffer
Definition: TGo4Task.h:299
void SendStatusMessage(Int_t level, Bool_t printout, const char *text,...)
Definition: TGo4Task.cxx:303
#define TGo4Buffer
Definition: TGo4Buffer.h:27
void SetMaster(Bool_t on=kTRUE)
Definition: TGo4Task.h:291
virtual TGo4TaskHandlerStatus * CreateStatus()
TObject * NextObject(Bool_t wait=kTRUE)
Definition: TGo4Task.cxx:217
virtual TGo4BufferQueue * GetStatusQueue(const char *task=0)
Definition: TGo4Task.cxx:164
void SetFlags(Bool_t blocking, Bool_t autocreate, Bool_t autostart, Bool_t terminating, Bool_t initdone)
void AddCommand(TGo4Command *com)
virtual void Terminate(Bool_t termapp=kTRUE)
Definition: TGo4Task.cxx:130
virtual void RestartMain()
Definition: TGo4Slave.cxx:85
void AddUserCommand(TGo4Command *com)
Definition: TGo4Task.cxx:237
void SetTask(TGo4Task *task, Bool_t delold=kTRUE)
virtual TGo4TaskStatus * CreateStatus()
Definition: TGo4Task.cxx:433
void UpdateStatusBuffer()
Definition: TGo4Task.cxx:340
virtual void KillMain()
Definition: TGo4Task.cxx:120
TGo4Command * MakeCommand(const char *name)
virtual void Start()
Definition: TGo4Task.cxx:105
TGo4TaskHandlerCommandList * GetPrototype()
Definition: TGo4Task.cxx:173
virtual void Quit()
Definition: TGo4Task.cxx:115
static TBuffer * CreateValueBuffer(UInt_t val)
TGo4Status * NextStatus(Bool_t wait=kTRUE)
Definition: TGo4Task.cxx:179
static Int_t Get_fgiTERMID()
Definition: TGo4Task.cxx:635
void SetMode(Go4CommandMode_t m)
Definition: TGo4Command.h:84
virtual void KillMain()
Definition: TGo4Slave.cxx:80
Bool_t SubmitEmergencyData(Go4EmergencyCommand_t val, const char *receiver=0)
Definition: TGo4Task.cxx:491
void AddBufferFromObject(TObject *object)
Bool_t IsLocal() const
virtual Int_t StartWorkThreads()
virtual void Terminate(Bool_t termapp=kTRUE)
static void Debug(const char *text,...)
Definition: TGo4Log.cxx:270
Bool_t IsMaster()
Definition: TGo4Task.h:94