Ignore:
Timestamp:
06/23/03 11:01:53 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mbase
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mbase/MClone.cc

    r2173 r2206  
    112112//  the name of it was given in the constructor.
    113113//
    114 Bool_t MClone::PreProcess(MParList *pList)
     114Int_t MClone::PreProcess(MParList *pList)
    115115{
    116116    //
     
    158158//  again.
    159159//
    160 Bool_t MClone::Process()
     160Int_t MClone::Process()
    161161{
    162162    //
  • trunk/MagicSoft/Mars/mbase/MClone.h

    r1540 r2206  
    2727    ~MClone();
    2828
    29     Bool_t PreProcess(MParList *pList);
    30     Bool_t Process();
     29    Int_t PreProcess(MParList *pList);
     30    Int_t Process();
    3131
    3232    TObject *GetClone() const  { return fClone; }
  • trunk/MagicSoft/Mars/mbase/MContinue.cc

    r2173 r2206  
    112112//  before this instance to the tasklist and preprocesses the filter.
    113113//
    114 Bool_t MContinue::PreProcess(MParList *list)
     114Int_t MContinue::PreProcess(MParList *list)
    115115{
    116116    if (!GetFilter())
     
    147147}
    148148
     149void MContinue::SetDisplay(MStatusDisplay *d)
     150{
     151    if (GetFilter())
     152        GetFilter()->SetDisplay(d);
     153
     154    MTask::SetDisplay(d);
     155}
     156
     157void MContinue::SetLogStream(MLog *lg)
     158{
     159    if (GetFilter())
     160        GetFilter()->SetLogStream(lg);
     161
     162    MTask::SetLogStream(lg);
     163}
     164
    149165// --------------------------------------------------------------------------
    150166//
     
    152168// from the tasklist.
    153169//
    154 Bool_t MContinue::PostProcess()
     170Int_t MContinue::PostProcess()
    155171{
    156172    if (!TestBit(kFilterIsPrivate))
  • trunk/MagicSoft/Mars/mbase/MContinue.h

    r1938 r2206  
    1515#endif
    1616
     17class MLog;
    1718class MFilter;
    1819class MTaskList;
     20class MStatusDisplay;
    1921
    2022class MContinue : public MTask
     
    2325    MTaskList *fTaskList;  //! pointer to the present tasklist
    2426
    25     Bool_t PreProcess(MParList *list);
    26     Bool_t Process() { return kCONTINUE; }
    27     Bool_t PostProcess();
     27    Int_t PreProcess(MParList *list);
     28    Int_t Process() { return kCONTINUE; }
     29    Int_t PostProcess();
    2830
    2931    enum { kIsOwner = BIT(14), kFilterIsPrivate = BIT(15) };
     
    3739    Bool_t IsInverted() const;
    3840
     41    void SetDisplay(MStatusDisplay *d);
     42    void SetLogStream(MLog *lg);
     43
    3944    ClassDef(MContinue, 1) //Task returning kCONTINUE
    4045};
  • trunk/MagicSoft/Mars/mbase/MEvtLoop.cc

    r2173 r2206  
    109109    fName = name;
    110110
     111    gROOT->GetListOfCleanups()->Add(this); // To remove fDisplay
     112
    111113    *fLog << inf << underline << "Instantiated MEvtLoop (" << name << "), using ROOT v" << ROOTVER << endl;
    112114}
     
    122124}
    123125
     126void MEvtLoop::SetParList(MParList *p)
     127{
     128    if (!p)
     129        return;
     130
     131    p->SetBit(kMustCleanup);
     132    fParList = p;
     133}
     134
    124135// --------------------------------------------------------------------------
    125136//
     
    152163}
    153164
     165void MEvtLoop::SetProgressBar(TGProgressBar *bar)
     166{
     167    fProgress = bar;
     168    fProgress->SetBit(kMustCleanup);
     169}
     170
    154171#ifdef __MARS__
    155172// --------------------------------------------------------------------------
     
    160177void MEvtLoop::SetProgressBar(MProgressBar *bar)
    161178{
    162     fProgress = bar->GetBar();
     179    SetProgressBar(bar->GetBar());
    163180}
    164181#endif
     
    200217    // Check whether display is still existing
    201218    //
    202     if (fDisplay && !gROOT->GetListOfSpecials()->FindObject(fDisplay))
    203         fDisplay = NULL;
    204219    if (fDisplay)
    205220    {
     
    238253Bool_t MEvtLoop::ProcessGuiEvents(Int_t num)
    239254{
    240     if (!fProgress)
     255    if (!fProgress || gROOT->IsBatch())
    241256        return kTRUE;
    242257
     
    255270            fDisplay->ClearStatus();
    256271            break;
    257         case MStatusDisplay::kFileExit:
    258             fParList->SetDisplay(NULL);
    259             delete fDisplay;
    260             SetDisplay(NULL);
    261             fProgress = NULL;
    262             gSystem->ProcessEvents();
    263             return kTRUE;
    264272        default:
    265273            *fLog << warn << "MEvtloop: fDisplay->ChecStatus() has returned unknown status #" << fDisplay->CheckStatus() << "... cleared." << endl;
     
    348356    Int_t entries = INT_MAX;
    349357
    350     if (fProgress)
     358    if (fProgress && !gROOT->IsBatch())
    351359    {
    352360        fProgress->Reset();
     
    409417    clock.Stop();
    410418
    411     if (fProgress)
     419    if (fProgress && !gROOT->IsBatch())
    412420    {
    413421        fProgress->SetPosition(maxcnt>0 ? TMath::Min(maxcnt, entries) : entries);
     
    912920    return kTRUE;
    913921}
     922
     923void MEvtLoop::RecursiveRemove(TObject *obj)
     924{
     925    if (obj==fParList)
     926    {
     927        fParList=NULL;
     928        fTaskList=NULL;
     929    }
     930
     931    if (obj==fProgress)
     932        fProgress = NULL;
     933
     934    if (obj==fDisplay)
     935    {
     936        if (fParList)
     937            fParList->SetDisplay(NULL);
     938        SetDisplay(NULL);
     939        fProgress = NULL;
     940    }
     941
     942    if (obj==fLog)
     943    {
     944        if (fParList)
     945            fParList->SetLogStream(NULL);
     946        SetLogStream(NULL);
     947    }
     948}
  • trunk/MagicSoft/Mars/mbase/MEvtLoop.h

    r2098 r2206  
    2828    MTaskList *fTaskList;      //!
    2929
    30     TGProgressBar   *fProgress;  //!
     30    TGProgressBar *fProgress;  //!
    3131
    3232    enum { kIsOwner = BIT(14) };
     
    4343    virtual ~MEvtLoop();
    4444
    45     void       SetParList(MParList *p)  { fParList = p; }
    46     MParList  *GetParList() const       { return fParList; }
    47     MTaskList *GetTaskList() const      { return fTaskList; }
     45    void       SetParList(MParList *p);
     46    MParList  *GetParList() const  { return fParList; }
     47    MTaskList *GetTaskList() const { return fTaskList; }
    4848
    4949    MTask *FindTask(const char *name) const;
     
    5454    void SetOwner(Bool_t enable=kTRUE);
    5555
    56     void SetProgressBar(TGProgressBar *bar) { fProgress = bar; }
     56    void SetProgressBar(TGProgressBar *bar);
    5757#ifdef __MARS__
    5858    void SetProgressBar(MProgressBar *bar);
     
    7777    Bool_t WriteEnv(TEnv &env, TString prefix="", Bool_t print=kFALSE) const;
    7878
     79    void RecursiveRemove(TObject *obj);
     80
    7981    ClassDef(MEvtLoop, 1) // Class to execute the tasks in a tasklist
    8082};
    8183
     84// FIXME: Move as (persistent) static data member to MParContainer
    8285R__EXTERN TList *gListOfPrimitives; // instantiation in MEvtLoop
    8386
  • trunk/MagicSoft/Mars/mbase/MGTask.cc

    r2173 r2206  
    7070//  MTask::CallPreProcess
    7171//
    72 Bool_t MGTask::CallPreProcess(MParList *plist)
     72Int_t MGTask::CallPreProcess(MParList *plist)
    7373{
    7474    HideGui();
     
    8282//  MTask::CallPostProcess
    8383//
    84 Bool_t MGTask::CallPostProcess()
     84Int_t MGTask::CallPostProcess()
    8585{
    8686    ShowGui();
  • trunk/MagicSoft/Mars/mbase/MGTask.h

    r1664 r2206  
    3838    virtual ~MGTask();
    3939
    40     Bool_t CallPreProcess(MParList *plist);
    41     Bool_t CallPostProcess();
     40    Int_t CallPreProcess(MParList *plist);
     41    Int_t CallPostProcess();
    4242
    4343    virtual Bool_t ProcessMessage(Int_t msg, Int_t submsg, Long_t param1, Long_t param2);
  • trunk/MagicSoft/Mars/mbase/MPrint.cc

    r2173 r2206  
    107107//  the name of it was given in the constructor.
    108108//
    109 Bool_t MPrint::PreProcess(MParList *pList)
     109Int_t MPrint::PreProcess(MParList *pList)
    110110{
    111111    //
     
    142142//  Calls overloaded TObject::Print
    143143//
    144 Bool_t MPrint::Process()
     144Int_t MPrint::Process()
    145145{
    146146    fObject->Print(fOption);
  • trunk/MagicSoft/Mars/mbase/MPrint.h

    r1542 r2206  
    2626    void EnableSkip(Bool_t skip=kTRUE) { skip ? SetBit(kSkip) : ResetBit(kSkip); }
    2727
    28     Bool_t PreProcess(MParList *pList);
    29     Bool_t Process();
     28    Int_t PreProcess(MParList *pList);
     29    Int_t Process();
    3030
    3131    ClassDef(MPrint, 0) // Task to call Print() function
  • trunk/MagicSoft/Mars/mbase/MTask.cc

    r2173 r2206  
    165165// Sets the preprocessed flag dependend on the return value of PreProcess.
    166166//
    167 Bool_t MTask::CallPreProcess(MParList *plist)
     167Int_t MTask::CallPreProcess(MParList *plist)
    168168{
    169169    fNumExecutions = 0;
     
    199199// If Process is executed, the execution counter is increased.
    200200//
    201 Bool_t MTask::CallProcess()
     201Int_t MTask::CallProcess()
    202202{
    203203    //
     
    221221// resets this flag.
    222222//
    223 Bool_t MTask::CallPostProcess()
     223Int_t MTask::CallPostProcess()
    224224{
    225225    if (!fIsPreprocessed)
     
    261261// the virtual implementation returns kTRUE
    262262//
    263 Bool_t MTask::PreProcess(MParList *pList)
     263Int_t MTask::PreProcess(MParList *pList)
    264264{
    265265    return kTRUE;
     
    272272// the virtual implementation returns kTRUE
    273273//
    274 Bool_t MTask::Process()
     274Int_t MTask::Process()
    275275{
    276276    return kTRUE;
     
    283283// the virtual implementation returns kTRUE
    284284//
    285 Bool_t MTask::PostProcess()
     285Int_t MTask::PostProcess()
    286286{
    287287    return kTRUE;
  • trunk/MagicSoft/Mars/mbase/MTask.h

    r2117 r2206  
    2929    UInt_t fNumExecutions;  //! Number of Excutions
    3030
    31     virtual Bool_t PreProcess(MParList *pList);
    32     virtual Bool_t Process();
    33     virtual Bool_t PostProcess();
     31    virtual Int_t PreProcess(MParList *pList);
     32    virtual Int_t Process();
     33    virtual Int_t PostProcess();
    3434
    3535protected:
     
    7575    virtual Bool_t ReInit(MParList *pList);
    7676
    77     virtual Bool_t CallPreProcess(MParList *plist);
    78     virtual Bool_t CallProcess();
    79     virtual Bool_t CallPostProcess();
     77    virtual Int_t CallPreProcess(MParList *plist);
     78    virtual Int_t CallProcess();
     79    virtual Int_t CallPostProcess();
    8080
    8181    const TList *GetListOfBranches() const { return fListOfBranches; }
  • trunk/MagicSoft/Mars/mbase/MTaskInteractive.cc

    r2178 r2206  
    7575}
    7676
    77 inline Bool_t MTaskInteractive::Return(Int_t no, void *params)
     77inline Int_t MTaskInteractive::Return(Int_t no, void *params)
    7878{
    7979    // Static function called when SetFCN is called in interactive mode
  • trunk/MagicSoft/Mars/mbase/MTaskInteractive.h

    r2156 r2206  
    2323    TMethodCall *fCall[3];
    2424
    25     Bool_t (*fPreProcess)(MParList *list);
    26     Bool_t (*fProcess)();
    27     Bool_t (*fPostProcess)();
     25    Int_t (*fPreProcess)(MParList *list);
     26    Int_t (*fProcess)();
     27    Int_t (*fPostProcess)();
    2828
    29     Bool_t PreProcess(MParList *list) { if (fCall[0]) return Return(0, &list); return fPreProcess  ? (*fPreProcess)(list) : kTRUE; }
    30     Bool_t Process()                  { if (fCall[1]) return Return(1);        return fProcess     ? (*fProcess)()        : kTRUE; }
    31     Bool_t PostProcess()              { if (fCall[2]) return Return(2);        return fPostProcess ? (*fPostProcess)()    : kTRUE; }
     29    Int_t PreProcess(MParList *list) { if (fCall[0]) return Return(0, &list); return fPreProcess  ? (*fPreProcess)(list) : kTRUE; }
     30    Int_t Process()                  { if (fCall[1]) return Return(1);        return fProcess     ? (*fProcess)()        : kTRUE; }
     31    Int_t PostProcess()              { if (fCall[2]) return Return(2);        return fPostProcess ? (*fPostProcess)()    : kTRUE; }
    3232
    33     Bool_t Return(Int_t no, void *param=NULL);
     33    Int_t Return(Int_t no, void *param=NULL);
    3434    Bool_t Set(void *fcn, Int_t no, const char *params);
    3535    void   Free(Int_t no);
     
    4040
    4141    // This is to be used in compiled code
    42     void SetPreProcess(Bool_t (*func)(MParList *list)) { fPreProcess = func;  Free(0); }
    43     void SetProcess(Bool_t (*func)())                  { fProcess = func;     Free(1);  }
    44     void SetPostProcess(Bool_t (*func)())              { fPostProcess = func; Free(2);  }
     42    void SetPreProcess(Int_t (*func)(MParList *list)) { fPreProcess = func;  Free(0); }
     43    void SetProcess(Int_t (*func)())                  { fProcess = func;     Free(1);  }
     44    void SetPostProcess(Int_t (*func)())              { fPostProcess = func; Free(2);  }
    4545
    4646    // This is for usage in CINT
  • trunk/MagicSoft/Mars/mbase/MTaskList.cc

    r2178 r2206  
    9292
    9393    fTasks = new TList;
     94
     95    gROOT->GetListOfCleanups()->Add(fTasks);
     96    gROOT->GetListOfCleanups()->Add(&fTasksProcess);
     97    fTasks->SetBit(kMustCleanup);
     98    fTasksProcess.SetBit(kMustCleanup);
    9499}
    95100
     
    212217    *fLog << inf << "Adding " << task->GetName() << " to " << GetName() << " for " << type << "... " << flush;
    213218    task->SetStreamId(type);
     219    task->SetBit(kMustCleanup);
    214220    fTasks->AddBefore((TObject*)where, task);
    215221    *fLog << "Done." << endl;
     
    232238    *fLog << inf << "Adding " << task->GetName() << " to " << GetName() << " for " << type << "... " << flush;
    233239    task->SetStreamId(type);
     240    task->SetBit(kMustCleanup);
    234241    fTasks->AddAfter((TObject*)where, task);
    235242    *fLog << "Done." << endl;
     
    252259    *fLog << inf << "Adding " << task->GetName() << " to " << GetName() << " for " << type << "... " << flush;
    253260    task->SetStreamId(type);
     261    task->SetBit(kMustCleanup);
    254262    fTasks->Add(task);
    255263    *fLog << "Done." << endl;
     
    331339//  doing no Processing are not Processed.
    332340//
    333 Bool_t MTaskList::PreProcess(MParList *pList)
     341Int_t MTaskList::PreProcess(MParList *pList)
    334342{
    335343    *fLog << all << "Preprocessing... " << flush;
     
    399407// do the event execution of all tasks in the task-list
    400408//
    401 Bool_t MTaskList::Process()
     409Int_t MTaskList::Process()
    402410{
    403411    //
     
    501509//  only tasks which have successfully been preprocessed are postprocessed.
    502510//
    503 Bool_t MTaskList::PostProcess()
     511Int_t MTaskList::PostProcess()
    504512{
    505513    *fLog << all << "Postprocessing... " << flush;
  • trunk/MagicSoft/Mars/mbase/MTaskList.h

    r2098 r2206  
    6363    Bool_t ReInit(MParList *pList=NULL);
    6464
    65     Bool_t PreProcess(MParList *pList);
    66     Bool_t Process();
    67     Bool_t PostProcess();
     65    Int_t PreProcess(MParList *pList);
     66    Int_t Process();
     67    Int_t PostProcess();
    6868
    6969    void Print(Option_t *opt = "") const;
Note: See TracChangeset for help on using the changeset viewer.