Changeset 8618 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 06/28/07 21:30:25 (18 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MTaskList.cc
r7808 r8618 89 89 // this name in the parameter list (by MEvtLoop::SetParList) 90 90 // 91 MTaskList::MTaskList(const char *name, const char *title) 91 MTaskList::MTaskList(const char *name, const char *title) : fNumPasses(0), fNumPass(0) 92 92 { 93 93 fName = name ? name : gsDefName.Data(); … … 108 108 // TaskList in the new TaskList. 109 109 // 110 MTaskList::MTaskList( MTaskList &ts) : MTask()110 MTaskList::MTaskList(const MTaskList &ts) : MTask(), fNumPasses(ts.fNumPasses) 111 111 { 112 112 fTasks->AddAll(ts.fTasks); … … 612 612 } 613 613 614 // -------------------------------------------------------------------------- 615 // 616 // do the event execution of all tasks in the task-list 617 // 618 Int_t MTaskList::Process() 619 { 620 // 621 // Check whether there is something which can be processed, otherwise 622 // stop the eventloop. 623 // 624 if (fTasksProcess.GetSize()==0) 625 { 626 *fLog << warn << "Warning: No entries in " << GetDescriptor() << " for Processing." << endl; 627 return kFALSE; 628 } 629 630 // 631 // Reset the ReadyToSave flag. 632 // Reset all containers. 633 // 634 // Make sure, that the parameter list is not reset from a tasklist 635 // running as a task in another tasklist. 636 // 637 const Bool_t noreset = fParList->TestBit(MParList::kIsProcessing); 638 if (!noreset) 639 { 640 fParList->SetBit(MParList::kIsProcessing); 641 if (!HasAccelerator(kAccDontReset)) 642 fParList->Reset(); 643 } 644 614 Int_t MTaskList::ProcessTaskList() 615 { 645 616 // 646 617 // create the Iterator for the TaskList … … 707 678 } 708 679 680 return rc; 681 } 682 683 // -------------------------------------------------------------------------- 684 // 685 // do the event execution of all tasks in the task-list. 686 // 687 // If a task returns kCONTINUE, kCONTINUE is propagated if the 688 // number of passes==0, otherwise kTRUE is returned instead. 689 // 690 Int_t MTaskList::Process() 691 { 692 // 693 // Check whether there is something which can be processed, otherwise 694 // stop the eventloop. 695 // 696 if (fTasksProcess.GetSize()==0) 697 { 698 *fLog << warn << "Warning: No entries in " << GetDescriptor() << " for Processing." << endl; 699 return kFALSE; 700 } 701 702 // 703 // Reset the ReadyToSave flag. 704 // Reset all containers. 705 // 706 // Make sure, that the parameter list is not reset from a tasklist 707 // running as a task in another tasklist. 708 // 709 const Bool_t noreset = fParList->TestBit(MParList::kIsProcessing); 710 if (!noreset) 711 { 712 fParList->SetBit(MParList::kIsProcessing); 713 if (!HasAccelerator(kAccDontReset)) 714 fParList->Reset(); 715 } 716 717 // Initialize storage variable for the return code 718 Int_t rc = kTRUE; 719 720 // Execute the task list at least once 721 const UInt_t cnt = fNumPasses==0 ? 1 : fNumPasses; 722 for (fNumPass=0; fNumPass<cnt; fNumPass++) 723 { 724 // Execute the tasklist once 725 rc = ProcessTaskList(); 726 // In cae of error or a stop-request leave loop 727 if (rc==kERROR || rc==kFALSE) 728 break; 729 } 730 731 // Reset to the default 709 732 if (!noreset) 710 733 { … … 713 736 } 714 737 738 // If the number of passes==0 <default> propagete kCONTINUE 739 if (rc==kCONTINUE) 740 return fNumPasses==0 ? kCONTINUE : kTRUE; 741 742 // Return return code 715 743 return rc; 716 744 } -
trunk/MagicSoft/Mars/mbase/MTaskList.h
r7808 r8618 28 28 MParList *fParList; //! The parameter list given in PreProcess 29 29 30 UInt_t fNumPasses; 31 UInt_t fNumPass; //! 32 30 33 enum { kIsOwner = BIT(14) }; 31 34 … … 33 36 void StreamPrimitive(ostream &out) const; 34 37 Bool_t CheckAddToList(MTask *task, /*const char *tType,*/ const MTask *where=NULL) const; 38 Int_t ProcessTaskList(); 35 39 36 40 public: 37 41 MTaskList(const char *name=NULL, const char *title=NULL); 38 MTaskList( MTaskList &ts);42 MTaskList(const MTaskList &ts); 39 43 40 44 ~MTaskList(); … … 43 47 void SetDisplay(MStatusDisplay *d); 44 48 void SetAccelerator(Byte_t acc=kAccStandard); 49 void SetNumPasses(UInt_t cnt=0) { fNumPasses=cnt; } 50 51 UInt_t GetNumPass() const { return fNumPass; } 52 UInt_t GetNumPasses() const { return fNumPasses; } 45 53 46 54 Bool_t AddToListBefore(MTask *task, const MTask *where, const char *tType="All");
Note:
See TracChangeset
for help on using the changeset viewer.