Changeset 1935 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 04/10/03 10:26:07 (22 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MContinue.cc
r1913 r1935 105 105 // -------------------------------------------------------------------------- 106 106 // 107 // In case the filter was created automatically, PreProcess tries to find 108 // the tasklist MTaskList, adds the filter before this instance to the 109 // tasklist and preprocesses the filter. 107 // PreProcess tries to find the tasklist MTaskList, adds the filter 108 // before this instance to the tasklist and preprocesses the filter. 110 109 // 111 110 Bool_t MContinue::PreProcess(MParList *list) 112 111 { 113 if (!TestBit(kIsOwner))114 return kTRUE;115 116 MTaskList *tlist = (MTaskList*)list->FindObject("MTaskList");117 if (!tlist)118 {119 *fLog << err << dbginf << "ERROR - Tasklist 'MTaskList' not found... abort." << endl;120 return kFALSE;121 }122 123 112 if (!GetFilter()) 124 113 { … … 127 116 } 128 117 129 if (!tlist->AddToListBefore(GetFilter(), this)) 118 fTaskList = (MTaskList*)list->FindObject("MTaskList"); 119 if (!fTaskList) 120 { 121 *fLog << err << dbginf << "ERROR - Tasklist 'MTaskList' not found... abort." << endl; 122 return kFALSE; 123 } 124 125 if (fTaskList->FindObject(GetFilter())) 126 { 127 *fLog << warn << dbginf << "WARNING - The filter is already in the tasklist..." << endl; 128 return kTRUE; 129 } 130 131 if (!fTaskList->AddToListBefore(GetFilter(), this)) 130 132 { 131 133 *fLog << err << dbginf << "ERROR - Adding filter before MContinue... abort." << endl; … … 133 135 } 134 136 137 SetBit(kFilterIsPrivate); 138 135 139 return GetFilter()->CallPreProcess(list); 136 140 } 141 142 // -------------------------------------------------------------------------- 143 // 144 // If the filter was added to the tasklist automatically it is removed 145 // from the tasklist. 146 // 147 Bool_t MContinue::PostProcess() 148 { 149 if (!TestBit(kFilterIsPrivate)) 150 return kTRUE; 151 152 if (fTaskList->RemoveFromList(GetFilter())) 153 return kTRUE; 154 155 *fLog << err << "ERROR: MContinue::PostProcess - Cannot remove Filter from tasklist" << endl; 156 157 return kFALSE; 158 } -
trunk/MagicSoft/Mars/mbase/MContinue.h
r1715 r1935 16 16 17 17 class MFilter; 18 class MTaskList; 18 19 19 20 class MContinue : public MTask 20 21 { 21 22 private: 23 MTaskList *fTaskList; //! pointer to the present tasklist 24 22 25 Bool_t PreProcess(MParList *list); 23 26 Bool_t Process() { return kCONTINUE; } 27 Bool_t PostProcess(); 24 28 25 enum { kIsOwner = BIT(14) };29 enum { kIsOwner = BIT(14), kFilterIsPrivate = BIT(15) }; 26 30 27 31 public: -
trunk/MagicSoft/Mars/mbase/MTaskList.cc
r1902 r1935 754 754 return kTRUE; 755 755 } 756 757 // -------------------------------------------------------------------------- 758 // 759 // Removes a task from the tasklist. Returns kFALSE if the object was not 760 // found in the list. 761 // 762 Bool_t MTaskList::RemoveFromList(MTask *task) 763 { 764 TObject *obj = fTasks->Remove(task); 765 766 // 767 // If the task was found in the list try to remove it from the second 768 // list, too. 769 // 770 if (obj) 771 fTasksProcess.Remove(task); 772 773 return obj ? kTRUE : kFALSE; 774 775 } -
trunk/MagicSoft/Mars/mbase/MTaskList.h
r1880 r1935 49 49 Bool_t AddToList(MTask *task, const char *tType="All"); 50 50 51 Bool_t RemoveFromList(MTask *task); 52 51 53 TObject *FindObject(const char *name) const; 52 54 TObject *FindObject(const TObject *obj) const;
Note:
See TracChangeset
for help on using the changeset viewer.