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