ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 #ifndef ROOT_TNamed
25 #include "TNamed.h"
26 #endif
27 #ifndef ROOT_TList
28 #include "TList.h"
29 #endif
30 
31 class TBrowser;
32 
33 
34 class TTask : public TNamed {
35 
36 protected:
37  TList *fTasks; //List of Tasks
38  TString fOption; //Option specified in ExecuteTask
39  Int_t fBreakin; //=1 if a break point set at task extry
40  Int_t fBreakout; //=1 if a break point set at task exit
41  Bool_t fHasExecuted; //True if task has executed
42  Bool_t fActive; //true if task is active
43 
44  static TTask *fgBeginTask; //pointer to task initiator
45  static TTask *fgBreakPoint; //pointer to current break point
46 
47 private:
48 
49 public:
50  TTask();
51  TTask(const char* name, const char *title);
52  virtual ~TTask();
53  TTask(const TTask &task);
54  TTask& operator=(const TTask& tt);
55 
56  virtual void Abort(); // *MENU*
57  virtual void Add(TTask *task) {fTasks->Add(task);}
58  virtual void Browse(TBrowser *b);
59  virtual void CleanTasks();
60  virtual void Clear(Option_t *option="");
61  virtual void Continue(); // *MENU*
62  virtual void Exec(Option_t *option);
63  virtual void ExecuteTask(Option_t *option="0"); // *MENU*
64  virtual void ExecuteTasks(Option_t *option);
65  Int_t GetBreakin() const { return fBreakin; }
66  Int_t GetBreakout() const { return fBreakout; }
67  Bool_t IsActive() const { return fActive; }
68  Bool_t IsFolder() const { return kTRUE; }
69  virtual void ls(Option_t *option="*") const; // *MENU*
70  void SetActive(Bool_t active=kTRUE) { fActive = active; } // *TOGGLE*
71  void SetBreakin(Int_t breakin=1) { fBreakin = breakin; } // *TOGGLE*
72  void SetBreakout(Int_t breakout=1) { fBreakout = breakout; } // *TOGGLE*
73  TList *GetListOfTasks() const { return fTasks; }
74 
75  ClassDef(TTask,1) //Base class for tasks
76 };
77 
78 #endif
void SetBreakout(Int_t breakout=1)
Definition: TTask.h:72
TTask & operator=(const TTask &tt)
Assignment operator.
Definition: TTask.cxx:118
virtual void ExecuteTask(Option_t *option="0")
Execute main task and its subtasks.
Definition: TTask.cxx:259
const char Option_t
Definition: RtypesCore.h:62
virtual void Clear(Option_t *option="")
Recursively call the Clear function of this task and its subtasks.
Definition: TTask.cxx:219
TTask is a base class that can be used to build a complex tree of Tasks.
Definition: TTask.h:34
static TTask * fgBeginTask
Definition: TTask.h:44
Int_t fBreakin
Definition: TTask.h:39
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TList * fTasks
Definition: TTask.h:37
void SetActive(Bool_t active=kTRUE)
Definition: TTask.h:70
Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects)...
Definition: TTask.h:68
virtual void Add(TTask *task)
Definition: TTask.h:57
void SetBreakin(Int_t breakin=1)
Definition: TTask.h:71
Int_t fBreakout
Definition: TTask.h:40
#define ClassDef(name, id)
Definition: Rtypes.h:254
TText * tt
Definition: textangle.C:16
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
TList * GetListOfTasks() const
Definition: TTask.h:73
virtual void Exec(Option_t *option)
Dummy Execute.
Definition: TTask.cxx:246
Bool_t fActive
Definition: TTask.h:42
A doubly linked list.
Definition: TList.h:47
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:41
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
virtual void Continue()
Resume execution at the current break point.
Definition: TTask.cxx:226
virtual void ls(Option_t *option="*") const
List the tree of tasks.
Definition: TTask.cxx:334
TString fOption
Definition: TTask.h:38
virtual ~TTask()
Delete a task and its subtasks.
Definition: TTask.cxx:158
Bool_t IsActive() const
Definition: TTask.h:67
virtual void Browse(TBrowser *b)
Browse the list of tasks.
Definition: TTask.cxx:190
virtual void Abort()
Abort current tree of tasks.
Definition: TTask.cxx:171
#define name(a, b)
Definition: linkTestLib0.cpp:5
virtual void ExecuteTasks(Option_t *option)
Execute all the subtasks of a task.
Definition: TTask.cxx:294
Int_t GetBreakin() const
Definition: TTask.h:65
virtual void Add(TObject *obj)
Definition: TList.h:81
virtual void CleanTasks()
Reset tasks state: breakpoints and execute flags also invokes the Clear function of each task to clea...
Definition: TTask.cxx:200
static TTask * fgBreakPoint
Definition: TTask.h:45
Int_t GetBreakout() const
Definition: TTask.h:66
const Bool_t kTRUE
Definition: Rtypes.h:91
Bool_t fHasExecuted
Definition: TTask.h:41