Changeset 2206 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 06/23/03 11:01:53 (22 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MClone.cc
r2173 r2206 112 112 // the name of it was given in the constructor. 113 113 // 114 Bool_t MClone::PreProcess(MParList *pList)114 Int_t MClone::PreProcess(MParList *pList) 115 115 { 116 116 // … … 158 158 // again. 159 159 // 160 Bool_t MClone::Process()160 Int_t MClone::Process() 161 161 { 162 162 // -
trunk/MagicSoft/Mars/mbase/MClone.h
r1540 r2206 27 27 ~MClone(); 28 28 29 Bool_t PreProcess(MParList *pList);30 Bool_t Process();29 Int_t PreProcess(MParList *pList); 30 Int_t Process(); 31 31 32 32 TObject *GetClone() const { return fClone; } -
trunk/MagicSoft/Mars/mbase/MContinue.cc
r2173 r2206 112 112 // before this instance to the tasklist and preprocesses the filter. 113 113 // 114 Bool_t MContinue::PreProcess(MParList *list)114 Int_t MContinue::PreProcess(MParList *list) 115 115 { 116 116 if (!GetFilter()) … … 147 147 } 148 148 149 void MContinue::SetDisplay(MStatusDisplay *d) 150 { 151 if (GetFilter()) 152 GetFilter()->SetDisplay(d); 153 154 MTask::SetDisplay(d); 155 } 156 157 void MContinue::SetLogStream(MLog *lg) 158 { 159 if (GetFilter()) 160 GetFilter()->SetLogStream(lg); 161 162 MTask::SetLogStream(lg); 163 } 164 149 165 // -------------------------------------------------------------------------- 150 166 // … … 152 168 // from the tasklist. 153 169 // 154 Bool_t MContinue::PostProcess()170 Int_t MContinue::PostProcess() 155 171 { 156 172 if (!TestBit(kFilterIsPrivate)) -
trunk/MagicSoft/Mars/mbase/MContinue.h
r1938 r2206 15 15 #endif 16 16 17 class MLog; 17 18 class MFilter; 18 19 class MTaskList; 20 class MStatusDisplay; 19 21 20 22 class MContinue : public MTask … … 23 25 MTaskList *fTaskList; //! pointer to the present tasklist 24 26 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(); 28 30 29 31 enum { kIsOwner = BIT(14), kFilterIsPrivate = BIT(15) }; … … 37 39 Bool_t IsInverted() const; 38 40 41 void SetDisplay(MStatusDisplay *d); 42 void SetLogStream(MLog *lg); 43 39 44 ClassDef(MContinue, 1) //Task returning kCONTINUE 40 45 }; -
trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
r2173 r2206 109 109 fName = name; 110 110 111 gROOT->GetListOfCleanups()->Add(this); // To remove fDisplay 112 111 113 *fLog << inf << underline << "Instantiated MEvtLoop (" << name << "), using ROOT v" << ROOTVER << endl; 112 114 } … … 122 124 } 123 125 126 void MEvtLoop::SetParList(MParList *p) 127 { 128 if (!p) 129 return; 130 131 p->SetBit(kMustCleanup); 132 fParList = p; 133 } 134 124 135 // -------------------------------------------------------------------------- 125 136 // … … 152 163 } 153 164 165 void MEvtLoop::SetProgressBar(TGProgressBar *bar) 166 { 167 fProgress = bar; 168 fProgress->SetBit(kMustCleanup); 169 } 170 154 171 #ifdef __MARS__ 155 172 // -------------------------------------------------------------------------- … … 160 177 void MEvtLoop::SetProgressBar(MProgressBar *bar) 161 178 { 162 fProgress = bar->GetBar();179 SetProgressBar(bar->GetBar()); 163 180 } 164 181 #endif … … 200 217 // Check whether display is still existing 201 218 // 202 if (fDisplay && !gROOT->GetListOfSpecials()->FindObject(fDisplay))203 fDisplay = NULL;204 219 if (fDisplay) 205 220 { … … 238 253 Bool_t MEvtLoop::ProcessGuiEvents(Int_t num) 239 254 { 240 if (!fProgress )255 if (!fProgress || gROOT->IsBatch()) 241 256 return kTRUE; 242 257 … … 255 270 fDisplay->ClearStatus(); 256 271 break; 257 case MStatusDisplay::kFileExit:258 fParList->SetDisplay(NULL);259 delete fDisplay;260 SetDisplay(NULL);261 fProgress = NULL;262 gSystem->ProcessEvents();263 return kTRUE;264 272 default: 265 273 *fLog << warn << "MEvtloop: fDisplay->ChecStatus() has returned unknown status #" << fDisplay->CheckStatus() << "... cleared." << endl; … … 348 356 Int_t entries = INT_MAX; 349 357 350 if (fProgress )358 if (fProgress && !gROOT->IsBatch()) 351 359 { 352 360 fProgress->Reset(); … … 409 417 clock.Stop(); 410 418 411 if (fProgress )419 if (fProgress && !gROOT->IsBatch()) 412 420 { 413 421 fProgress->SetPosition(maxcnt>0 ? TMath::Min(maxcnt, entries) : entries); … … 912 920 return kTRUE; 913 921 } 922 923 void 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 28 28 MTaskList *fTaskList; //! 29 29 30 TGProgressBar 30 TGProgressBar *fProgress; //! 31 31 32 32 enum { kIsOwner = BIT(14) }; … … 43 43 virtual ~MEvtLoop(); 44 44 45 void SetParList(MParList *p) { fParList = p; }46 MParList *GetParList() const 47 MTaskList *GetTaskList() const 45 void SetParList(MParList *p); 46 MParList *GetParList() const { return fParList; } 47 MTaskList *GetTaskList() const { return fTaskList; } 48 48 49 49 MTask *FindTask(const char *name) const; … … 54 54 void SetOwner(Bool_t enable=kTRUE); 55 55 56 void SetProgressBar(TGProgressBar *bar) { fProgress = bar; }56 void SetProgressBar(TGProgressBar *bar); 57 57 #ifdef __MARS__ 58 58 void SetProgressBar(MProgressBar *bar); … … 77 77 Bool_t WriteEnv(TEnv &env, TString prefix="", Bool_t print=kFALSE) const; 78 78 79 void RecursiveRemove(TObject *obj); 80 79 81 ClassDef(MEvtLoop, 1) // Class to execute the tasks in a tasklist 80 82 }; 81 83 84 // FIXME: Move as (persistent) static data member to MParContainer 82 85 R__EXTERN TList *gListOfPrimitives; // instantiation in MEvtLoop 83 86 -
trunk/MagicSoft/Mars/mbase/MGTask.cc
r2173 r2206 70 70 // MTask::CallPreProcess 71 71 // 72 Bool_t MGTask::CallPreProcess(MParList *plist)72 Int_t MGTask::CallPreProcess(MParList *plist) 73 73 { 74 74 HideGui(); … … 82 82 // MTask::CallPostProcess 83 83 // 84 Bool_t MGTask::CallPostProcess()84 Int_t MGTask::CallPostProcess() 85 85 { 86 86 ShowGui(); -
trunk/MagicSoft/Mars/mbase/MGTask.h
r1664 r2206 38 38 virtual ~MGTask(); 39 39 40 Bool_t CallPreProcess(MParList *plist);41 Bool_t CallPostProcess();40 Int_t CallPreProcess(MParList *plist); 41 Int_t CallPostProcess(); 42 42 43 43 virtual Bool_t ProcessMessage(Int_t msg, Int_t submsg, Long_t param1, Long_t param2); -
trunk/MagicSoft/Mars/mbase/MPrint.cc
r2173 r2206 107 107 // the name of it was given in the constructor. 108 108 // 109 Bool_t MPrint::PreProcess(MParList *pList)109 Int_t MPrint::PreProcess(MParList *pList) 110 110 { 111 111 // … … 142 142 // Calls overloaded TObject::Print 143 143 // 144 Bool_t MPrint::Process()144 Int_t MPrint::Process() 145 145 { 146 146 fObject->Print(fOption); -
trunk/MagicSoft/Mars/mbase/MPrint.h
r1542 r2206 26 26 void EnableSkip(Bool_t skip=kTRUE) { skip ? SetBit(kSkip) : ResetBit(kSkip); } 27 27 28 Bool_t PreProcess(MParList *pList);29 Bool_t Process();28 Int_t PreProcess(MParList *pList); 29 Int_t Process(); 30 30 31 31 ClassDef(MPrint, 0) // Task to call Print() function -
trunk/MagicSoft/Mars/mbase/MTask.cc
r2173 r2206 165 165 // Sets the preprocessed flag dependend on the return value of PreProcess. 166 166 // 167 Bool_t MTask::CallPreProcess(MParList *plist)167 Int_t MTask::CallPreProcess(MParList *plist) 168 168 { 169 169 fNumExecutions = 0; … … 199 199 // If Process is executed, the execution counter is increased. 200 200 // 201 Bool_t MTask::CallProcess()201 Int_t MTask::CallProcess() 202 202 { 203 203 // … … 221 221 // resets this flag. 222 222 // 223 Bool_t MTask::CallPostProcess()223 Int_t MTask::CallPostProcess() 224 224 { 225 225 if (!fIsPreprocessed) … … 261 261 // the virtual implementation returns kTRUE 262 262 // 263 Bool_t MTask::PreProcess(MParList *pList)263 Int_t MTask::PreProcess(MParList *pList) 264 264 { 265 265 return kTRUE; … … 272 272 // the virtual implementation returns kTRUE 273 273 // 274 Bool_t MTask::Process()274 Int_t MTask::Process() 275 275 { 276 276 return kTRUE; … … 283 283 // the virtual implementation returns kTRUE 284 284 // 285 Bool_t MTask::PostProcess()285 Int_t MTask::PostProcess() 286 286 { 287 287 return kTRUE; -
trunk/MagicSoft/Mars/mbase/MTask.h
r2117 r2206 29 29 UInt_t fNumExecutions; //! Number of Excutions 30 30 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(); 34 34 35 35 protected: … … 75 75 virtual Bool_t ReInit(MParList *pList); 76 76 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(); 80 80 81 81 const TList *GetListOfBranches() const { return fListOfBranches; } -
trunk/MagicSoft/Mars/mbase/MTaskInteractive.cc
r2178 r2206 75 75 } 76 76 77 inline Bool_t MTaskInteractive::Return(Int_t no, void *params)77 inline Int_t MTaskInteractive::Return(Int_t no, void *params) 78 78 { 79 79 // Static function called when SetFCN is called in interactive mode -
trunk/MagicSoft/Mars/mbase/MTaskInteractive.h
r2156 r2206 23 23 TMethodCall *fCall[3]; 24 24 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)(); 28 28 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; } 32 32 33 Bool_t Return(Int_t no, void *param=NULL);33 Int_t Return(Int_t no, void *param=NULL); 34 34 Bool_t Set(void *fcn, Int_t no, const char *params); 35 35 void Free(Int_t no); … … 40 40 41 41 // 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); } 45 45 46 46 // This is for usage in CINT -
trunk/MagicSoft/Mars/mbase/MTaskList.cc
r2178 r2206 92 92 93 93 fTasks = new TList; 94 95 gROOT->GetListOfCleanups()->Add(fTasks); 96 gROOT->GetListOfCleanups()->Add(&fTasksProcess); 97 fTasks->SetBit(kMustCleanup); 98 fTasksProcess.SetBit(kMustCleanup); 94 99 } 95 100 … … 212 217 *fLog << inf << "Adding " << task->GetName() << " to " << GetName() << " for " << type << "... " << flush; 213 218 task->SetStreamId(type); 219 task->SetBit(kMustCleanup); 214 220 fTasks->AddBefore((TObject*)where, task); 215 221 *fLog << "Done." << endl; … … 232 238 *fLog << inf << "Adding " << task->GetName() << " to " << GetName() << " for " << type << "... " << flush; 233 239 task->SetStreamId(type); 240 task->SetBit(kMustCleanup); 234 241 fTasks->AddAfter((TObject*)where, task); 235 242 *fLog << "Done." << endl; … … 252 259 *fLog << inf << "Adding " << task->GetName() << " to " << GetName() << " for " << type << "... " << flush; 253 260 task->SetStreamId(type); 261 task->SetBit(kMustCleanup); 254 262 fTasks->Add(task); 255 263 *fLog << "Done." << endl; … … 331 339 // doing no Processing are not Processed. 332 340 // 333 Bool_t MTaskList::PreProcess(MParList *pList)341 Int_t MTaskList::PreProcess(MParList *pList) 334 342 { 335 343 *fLog << all << "Preprocessing... " << flush; … … 399 407 // do the event execution of all tasks in the task-list 400 408 // 401 Bool_t MTaskList::Process()409 Int_t MTaskList::Process() 402 410 { 403 411 // … … 501 509 // only tasks which have successfully been preprocessed are postprocessed. 502 510 // 503 Bool_t MTaskList::PostProcess()511 Int_t MTaskList::PostProcess() 504 512 { 505 513 *fLog << all << "Postprocessing... " << flush; -
trunk/MagicSoft/Mars/mbase/MTaskList.h
r2098 r2206 63 63 Bool_t ReInit(MParList *pList=NULL); 64 64 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(); 68 68 69 69 void Print(Option_t *opt = "") const;
Note:
See TracChangeset
for help on using the changeset viewer.