Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:12:28

0001 // @(#)root/base:$Id$
0002 // Author: Rene Brun   02/09/2000
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TTask
0013 #define ROOT_TTask
0014 
0015 
0016 //////////////////////////////////////////////////////////////////////////
0017 //                                                                      //
0018 // TTask                                                                //
0019 //                                                                      //
0020 // Base class for recursive execution of tasks.                         //
0021 //                                                                      //
0022 //////////////////////////////////////////////////////////////////////////
0023 
0024 #include "TNamed.h"
0025 
0026 #ifdef R__LESS_INCLUDES
0027 class TList;
0028 #else
0029 #include "TList.h"
0030 #endif
0031 
0032 class TBrowser;
0033 
0034 
0035 class TTask : public TNamed {
0036 
0037 protected:
0038    TList        *fTasks;        //List of Tasks
0039    TString       fOption;       //Option specified in ExecuteTask
0040    Int_t         fBreakin;      //=1 if a break point set at task extry
0041    Int_t         fBreakout;     //=1 if a break point set at task exit
0042    Bool_t        fHasExecuted;  //True if task has executed
0043    Bool_t        fActive;       //true if task is active
0044 
0045    static TTask *fgBeginTask;    //pointer to task initiator
0046    static TTask *fgBreakPoint;   //pointer to current break point
0047 
0048 private:
0049 
0050 public:
0051    TTask();
0052    TTask(const char* name, const char *title);
0053    virtual ~TTask();
0054    TTask(const TTask &task);
0055    TTask& operator=(const TTask& tt);
0056 
0057    virtual void  Abort();  // *MENU*
0058    virtual void  Add(TTask *task);
0059            void  Browse(TBrowser *b) override;
0060    virtual void  CleanTasks();
0061            void  Clear(Option_t *option="") override;
0062    virtual void  Continue(); // *MENU*
0063    virtual void  Exec(Option_t *option);
0064    virtual void  ExecuteTask(Option_t *option="0");  // *MENU*
0065    virtual void  ExecuteTasks(Option_t *option);
0066           Int_t  GetBreakin() const { return fBreakin; }
0067           Int_t  GetBreakout() const { return fBreakout; }
0068          Bool_t  IsActive() const { return fActive; }
0069          Bool_t  IsFolder() const override { return kTRUE; }
0070            void  ls(Option_t *option="*") const override;  // *MENU*
0071            void  SetActive(Bool_t active=kTRUE) { fActive = active; } // *TOGGLE*
0072            void  SetBreakin(Int_t breakin=1) { fBreakin = breakin; } // *TOGGLE*
0073            void  SetBreakout(Int_t breakout=1) { fBreakout = breakout; } // *TOGGLE*
0074           TList *GetListOfTasks() const { return fTasks; }
0075 
0076    ClassDefOverride(TTask,1)  //Base class for tasks
0077 };
0078 
0079 #endif