Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TTask.h
Go to the documentation of this file.
1 // @(#)root/base:$Id$
2 // Author: Rene Brun 02/09/2000
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TTask
13 #define ROOT_TTask
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TTask //
19 // //
20 // Base class for recursive execution of tasks. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #include "TNamed.h"
25 #include "TList.h"
26 
27 class TBrowser;
28 
29 
30 class TTask : public TNamed {
31 
32 protected:
33  TList *fTasks; //List of Tasks
34  TString fOption; //Option specified in ExecuteTask
35  Int_t fBreakin; //=1 if a break point set at task extry
36  Int_t fBreakout; //=1 if a break point set at task exit
37  Bool_t fHasExecuted; //True if task has executed
38  Bool_t fActive; //true if task is active
39 
40  static TTask *fgBeginTask; //pointer to task initiator
41  static TTask *fgBreakPoint; //pointer to current break point
42 
43 private:
44 
45 public:
46  TTask();
47  TTask(const char* name, const char *title);
48  virtual ~TTask();
49  TTask(const TTask &task);
50  TTask& operator=(const TTask& tt);
51 
52  virtual void Abort(); // *MENU*
53  virtual void Add(TTask *task) {fTasks->Add(task);}
54  virtual void Browse(TBrowser *b);
55  virtual void CleanTasks();
56  virtual void Clear(Option_t *option="");
57  virtual void Continue(); // *MENU*
58  virtual void Exec(Option_t *option);
59  virtual void ExecuteTask(Option_t *option="0"); // *MENU*
60  virtual void ExecuteTasks(Option_t *option);
61  Int_t GetBreakin() const { return fBreakin; }
62  Int_t GetBreakout() const { return fBreakout; }
63  Bool_t IsActive() const { return fActive; }
64  Bool_t IsFolder() const { return kTRUE; }
65  virtual void ls(Option_t *option="*") const; // *MENU*
66  void SetActive(Bool_t active=kTRUE) { fActive = active; } // *TOGGLE*
67  void SetBreakin(Int_t breakin=1) { fBreakin = breakin; } // *TOGGLE*
68  void SetBreakout(Int_t breakout=1) { fBreakout = breakout; } // *TOGGLE*
69  TList *GetListOfTasks() const { return fTasks; }
70 
71  ClassDef(TTask,1) //Base class for tasks
72 };
73 
74 #endif