Logo ROOT   6.14/05
Reference Guide
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
Int_t GetBreakout() const
Definition: TTask.h:62
void SetBreakout(Int_t breakout=1)
Definition: TTask.h:68
TList * GetListOfTasks() const
Definition: TTask.h:69
auto * tt
Definition: textangle.C:16
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:30
static TTask * fgBeginTask
Definition: TTask.h:40
Int_t fBreakin
Definition: TTask.h:35
Basic string class.
Definition: TString.h:131
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TList * fTasks
Definition: TTask.h:33
void SetActive(Bool_t active=kTRUE)
Definition: TTask.h:66
TTask()
Default constructor invoked when reading a TTask object from a file.
Definition: TTask.cxx:95
Bool_t IsActive() const
Definition: TTask.h:63
virtual void Add(TTask *task)
Definition: TTask.h:53
void SetBreakin(Int_t breakin=1)
Definition: TTask.h:67
Int_t fBreakout
Definition: TTask.h:36
#define ClassDef(name, id)
Definition: Rtypes.h:320
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects)...
Definition: TTask.h:64
virtual void Exec(Option_t *option)
Dummy Execute.
Definition: TTask.cxx:248
Bool_t fActive
Definition: TTask.h:38
A doubly linked list.
Definition: TList.h:44
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:37
virtual void Continue()
Resume execution at the current break point.
Definition: TTask.cxx:228
TString fOption
Definition: TTask.h:34
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:87
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:41
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
Bool_t fHasExecuted
Definition: TTask.h:37
const Bool_t kTRUE
Definition: RtypesCore.h:87
char name[80]
Definition: TGX11.cxx:109
Int_t GetBreakin() const
Definition: TTask.h:61