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 void Browse(TBrowser *b) override;
60 virtual void CleanTasks();
61 void Clear(Option_t *option="") override;
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 override { return kTRUE; }
70 void ls(Option_t *option="*") const override; // *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 ClassDefOverride(TTask,1) //Base class for tasks
77};
78
79#endif
#define b(i)
Definition RSha256.hxx:100
constexpr Bool_t kTRUE
Definition RtypesCore.h:93
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
Option_t Option_t option
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:139
<div class="legacybox"><h2>Legacy Code</h2> TTask is a legacy interface: there will be no bug fixes n...
Definition TTask.h:35
virtual void Exec(Option_t *option)
Dummy Execute.
Definition TTask.cxx:267
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:124
TString fOption
Definition TTask.h:39
void ls(Option_t *option="*") const override
List the tree of tasks.
Definition TTask.cxx:359
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:168
Int_t GetBreakin() const
Definition TTask.h:66
Bool_t IsActive() const
Definition TTask.h:68
void Browse(TBrowser *b) override
Browse the list of tasks.
Definition TTask.cxx:211
virtual void CleanTasks()
Reset tasks state: breakpoints and execute flags also invokes the Clear function of each task to clea...
Definition TTask.cxx:222
Int_t fBreakout
Definition TTask.h:41
virtual void ExecuteTasks(Option_t *option)
Execute all the subtasks of a task.
Definition TTask.cxx:315
Bool_t fActive
Definition TTask.h:43
TTask()
Default constructor invoked when reading a TTask object from a file.
Definition TTask.cxx:98
Bool_t fHasExecuted
Definition TTask.h:42
virtual void Abort()
Abort current tree of tasks.
Definition TTask.cxx:192
virtual void Add(TTask *task)
Add TTask to this.
Definition TTask.cxx:176
Bool_t IsFolder() const override
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
Definition TTask.h:69
void Clear(Option_t *option="") override
Recursively call the Clear function of this task and its subtasks.
Definition TTask.cxx:240
TList * fTasks
Definition TTask.h:38
void SetBreakout(Int_t breakout=1)
Definition TTask.h:73
virtual void Continue()
Resume execution at the current break point.
Definition TTask.cxx:247
virtual void ExecuteTask(Option_t *option="0")
Execute main task and its subtasks.
Definition TTask.cxx:280
Int_t GetBreakout() const
Definition TTask.h:67
auto * tt
Definition textangle.C:16