ROOT logo
// @(#)root/base:$Id$
// Author: Rene Brun   02/09/2000

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TTask
#define ROOT_TTask


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TTask                                                                //
//                                                                      //
// Base class for recursive execution of tasks.                         //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TNamed
#include "TNamed.h"
#endif
#ifndef ROOT_TList
#include "TList.h"
#endif

class TBrowser;


class TTask : public TNamed {

protected:
   TList        *fTasks;        //List of Tasks
   TString       fOption;       //Option specified in ExecuteTask
   Int_t         fBreakin;      //=1 if a break point set at task extry
   Int_t         fBreakout;     //=1 if a break point set at task exit
   Bool_t        fHasExecuted;  //True if task has executed
   Bool_t        fActive;       //true if task is active

   static TTask *fgBeginTask;    //pointer to task initiator
   static TTask *fgBreakPoint;   //pointer to current break point

private:

public:
   TTask();
   TTask(const char* name, const char *title);
   virtual ~TTask();
   TTask(const TTask &task);          
   TTask& operator=(const TTask& tt); 

   virtual void  Abort();  // *MENU*
   virtual void  Add(TTask *task) {fTasks->Add(task);}
   virtual void  Browse(TBrowser *b);
   virtual void  CleanTasks();
   virtual void  Clear(Option_t *option="");
   virtual void  Continue(); // *MENU*
   virtual void  Exec(Option_t *option);
   virtual void  ExecuteTask(Option_t *option="0");  // *MENU*
   virtual void  ExecuteTasks(Option_t *option);
   Int_t         GetBreakin() const { return fBreakin; }
   Int_t         GetBreakout() const { return fBreakout; }
         Bool_t  IsActive() const { return fActive; }
         Bool_t  IsFolder() const { return kTRUE; }
   virtual void  ls(Option_t *option="*") const;  // *MENU*
           void  SetActive(Bool_t active=kTRUE) { fActive = active; } // *TOGGLE*
           void  SetBreakin(Int_t breakin=1) { fBreakin = breakin; } // *TOGGLE*
           void  SetBreakout(Int_t breakout=1) { fBreakout = breakout; } // *TOGGLE*
   TList        *GetListOfTasks() const { return fTasks; }

   ClassDef(TTask,1)  //Base class for tasks
};

#endif
 TTask.h:1
 TTask.h:2
 TTask.h:3
 TTask.h:4
 TTask.h:5
 TTask.h:6
 TTask.h:7
 TTask.h:8
 TTask.h:9
 TTask.h:10
 TTask.h:11
 TTask.h:12
 TTask.h:13
 TTask.h:14
 TTask.h:15
 TTask.h:16
 TTask.h:17
 TTask.h:18
 TTask.h:19
 TTask.h:20
 TTask.h:21
 TTask.h:22
 TTask.h:23
 TTask.h:24
 TTask.h:25
 TTask.h:26
 TTask.h:27
 TTask.h:28
 TTask.h:29
 TTask.h:30
 TTask.h:31
 TTask.h:32
 TTask.h:33
 TTask.h:34
 TTask.h:35
 TTask.h:36
 TTask.h:37
 TTask.h:38
 TTask.h:39
 TTask.h:40
 TTask.h:41
 TTask.h:42
 TTask.h:43
 TTask.h:44
 TTask.h:45
 TTask.h:46
 TTask.h:47
 TTask.h:48
 TTask.h:49
 TTask.h:50
 TTask.h:51
 TTask.h:52
 TTask.h:53
 TTask.h:54
 TTask.h:55
 TTask.h:56
 TTask.h:57
 TTask.h:58
 TTask.h:59
 TTask.h:60
 TTask.h:61
 TTask.h:62
 TTask.h:63
 TTask.h:64
 TTask.h:65
 TTask.h:66
 TTask.h:67
 TTask.h:68
 TTask.h:69
 TTask.h:70
 TTask.h:71
 TTask.h:72
 TTask.h:73
 TTask.h:74
 TTask.h:75
 TTask.h:76
 TTask.h:77
 TTask.h:78