Logo ROOT  
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 
26 #ifdef R__LESS_INCLUDES
27 class TList;
28 #else
29 #include "TList.h"
30 #endif
31 
32 class TBrowser;
33 
34 
35 class TTask : public TNamed {
36 
37 protected:
38  TList *fTasks; //List of Tasks
39  TString fOption; //Option specified in ExecuteTask
40  Int_t fBreakin; //=1 if a break point set at task extry
41  Int_t fBreakout; //=1 if a break point set at task exit
42  Bool_t fHasExecuted; //True if task has executed
43  Bool_t fActive; //true if task is active
44 
45  static TTask *fgBeginTask; //pointer to task initiator
46  static TTask *fgBreakPoint; //pointer to current break point
47 
48 private:
49 
50 public:
51  TTask();
52  TTask(const char* name, const char *title);
53  virtual ~TTask();
54  TTask(const TTask &task);
55  TTask& operator=(const TTask& tt);
56 
57  virtual void Abort(); // *MENU*
58  virtual void Add(TTask *task);
59  virtual void Browse(TBrowser *b);
60  virtual void CleanTasks();
61  virtual void Clear(Option_t *option="");
62  virtual void Continue(); // *MENU*
63  virtual void Exec(Option_t *option);
64  virtual void ExecuteTask(Option_t *option="0"); // *MENU*
65  virtual void ExecuteTasks(Option_t *option);
66  Int_t GetBreakin() const { return fBreakin; }
67  Int_t GetBreakout() const { return fBreakout; }
68  Bool_t IsActive() const { return fActive; }
69  Bool_t IsFolder() const { return kTRUE; }
70  virtual void ls(Option_t *option="*") const; // *MENU*
71  void SetActive(Bool_t active=kTRUE) { fActive = active; } // *TOGGLE*
72  void SetBreakin(Int_t breakin=1) { fBreakin = breakin; } // *TOGGLE*
73  void SetBreakout(Int_t breakout=1) { fBreakout = breakout; } // *TOGGLE*
74  TList *GetListOfTasks() const { return fTasks; }
75 
76  ClassDef(TTask,1) //Base class for tasks
77 };
78 
79 #endif
TTask::Add
virtual void Add(TTask *task)
Add TTask to this.
Definition: TTask.cxx:172
TBrowser
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
tt
auto * tt
Definition: textangle.C:16
TTask::fTasks
TList * fTasks
Definition: TTask.h:38
TTask::Clear
virtual void Clear(Option_t *option="")
Recursively call the Clear function of this task and its subtasks.
Definition: TTask.cxx:232
TTask::fHasExecuted
Bool_t fHasExecuted
Definition: TTask.h:42
TTask::GetListOfTasks
TList * GetListOfTasks() const
Definition: TTask.h:74
Option_t
const char Option_t
Definition: RtypesCore.h:66
TTask::fgBeginTask
static TTask * fgBeginTask
Definition: TTask.h:45
TTask::SetActive
void SetActive(Bool_t active=kTRUE)
Definition: TTask.h:71
TTask::GetBreakin
Int_t GetBreakin() const
Definition: TTask.h:66
TTask::TTask
TTask()
Default constructor invoked when reading a TTask object from a file.
Definition: TTask.cxx:96
TTask::fBreakin
Int_t fBreakin
Definition: TTask.h:40
TNamed.h
TTask::IsFolder
Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
Definition: TTask.h:69
TTask::ExecuteTask
virtual void ExecuteTask(Option_t *option="0")
Execute main task and its subtasks.
Definition: TTask.cxx:272
TList.h
TTask::fBreakout
Int_t fBreakout
Definition: TTask.h:41
TString
Basic string class.
Definition: TString.h:136
b
#define b(i)
Definition: RSha256.hxx:100
TTask::SetBreakin
void SetBreakin(Int_t breakin=1)
Definition: TTask.h:72
bool
TTask::IsActive
Bool_t IsActive() const
Definition: TTask.h:68
TTask::ls
virtual void ls(Option_t *option="*") const
List the tree of tasks.
Definition: TTask.cxx:347
TTask
TTask is a base class that can be used to build a complex tree of Tasks.
Definition: TTask.h:35
TTask::fActive
Bool_t fActive
Definition: TTask.h:43
TNamed
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
TTask::Exec
virtual void Exec(Option_t *option)
Dummy Execute.
Definition: TTask.cxx:259
TTask::ExecuteTasks
virtual void ExecuteTasks(Option_t *option)
Execute all the subtasks of a task.
Definition: TTask.cxx:307
TTask::fOption
TString fOption
Definition: TTask.h:39
TTask::CleanTasks
virtual void CleanTasks()
Reset tasks state: breakpoints and execute flags also invokes the Clear function of each task to clea...
Definition: TTask.cxx:213
TTask::Browse
virtual void Browse(TBrowser *b)
Browse the list of tasks.
Definition: TTask.cxx:203
TTask::Continue
virtual void Continue()
Resume execution at the current break point.
Definition: TTask.cxx:239
TTask::~TTask
virtual ~TTask()
Delete a task and its subtasks.
Definition: TTask.cxx:161
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
name
char name[80]
Definition: TGX11.cxx:110
TTask::GetBreakout
Int_t GetBreakout() const
Definition: TTask.h:67
TTask::fgBreakPoint
static TTask * fgBreakPoint
Definition: TTask.h:46
TTask::operator=
TTask & operator=(const TTask &tt)
Assignment operator.
Definition: TTask.cxx:121
TTask::Abort
virtual void Abort()
Abort current tree of tasks.
Definition: TTask.cxx:184
TTask::SetBreakout
void SetBreakout(Int_t breakout=1)
Definition: TTask.h:73
TList
A doubly linked list.
Definition: TList.h:44
int