Logo ROOT   6.08/07
Reference Guide
Go to the documentation of this file.
1 // @(#)root/base:$Id$
2 // Author: Rene Brun 02/09/2000
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  *************************************************************************/
12 #ifndef ROOT_TTask
13 #define ROOT_TTask
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TTask //
19 // //
20 // Base class for recursive execution of tasks. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
24 #ifndef ROOT_TNamed
25 #include "TNamed.h"
26 #endif
27 #ifndef ROOT_TList
28 #include "TList.h"
29 #endif
31 class TBrowser;
34 class TTask : public TNamed {
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
44  static TTask *fgBeginTask; //pointer to task initiator
45  static TTask *fgBreakPoint; //pointer to current break point
47 private:
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);
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; }
75  ClassDef(TTask,1) //Base class for tasks
76 };
78 #endif
Int_t GetBreakout() const
Definition: TTask.h:66
void SetBreakout(Int_t breakout=1)
Definition: TTask.h:72
TList * GetListOfTasks() const
Definition: TTask.h:73
TTask & operator=(const TTask &tt)
Assignment operator.
Definition: TTask.cxx:120
virtual void ExecuteTask(Option_t *option="0")
Execute main task and its subtasks.
Definition: TTask.cxx:261
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:221
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
Default constructor invoked when reading a TTask object from a file.
Definition: TTask.cxx:95
Bool_t IsActive() const
Definition: TTask.h:67
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
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 Exec(Option_t *option)
Dummy Execute.
Definition: TTask.cxx:248
Bool_t fActive
Definition: TTask.h:42
A doubly linked list.
Definition: TList.h:47
virtual void ls(Option_t *option="*") const
List the tree of tasks.
Definition: TTask.cxx:336
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:41
virtual void Continue()
Resume execution at the current break point.
Definition: TTask.cxx:228
TString fOption
Definition: TTask.h:38
virtual ~TTask()
Delete a task and its subtasks.
Definition: TTask.cxx:160
virtual void Browse(TBrowser *b)
Browse the list of tasks.
Definition: TTask.cxx:192
virtual void Abort()
Abort current tree of tasks.
Definition: TTask.cxx:173
virtual void ExecuteTasks(Option_t *option)
Execute all the subtasks of a task.
Definition: TTask.cxx:296
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:202
static TTask * fgBreakPoint
Definition: TTask.h:45
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition: TRolke.cxx:630
const Bool_t kTRUE
Definition: Rtypes.h:91
Bool_t fHasExecuted
Definition: TTask.h:41
char name[80]
Definition: TGX11.cxx:109
Int_t GetBreakin() const
Definition: TTask.h:65