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