Changeset 1661 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 11/21/02 15:04:04 (22 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MTask.h
r1574 r1661 65 65 virtual ~MTask(); 66 66 67 v oid SetFilter(MFilter *filter) { fFilter=filter; }67 virtual void SetFilter(MFilter *filter) { fFilter=filter; } 68 68 const MFilter *GetFilter() const { return fFilter; } 69 MFilter *GetFilter() { return fFilter; } // for MContinue only 69 70 virtual void PrintStatistics(const Int_t lvl=0, Bool_t title=kFALSE) const; 70 71 -
trunk/MagicSoft/Mars/mbase/MTaskList.cc
r1657 r1661 135 135 } 136 136 137 138 // -------------------------------------------------------------------------- 139 // 140 // schedule task for execution, whether as first task, or after 141 // 'where'. 'tType' is the event type which should be processed 142 // 143 Bool_t MTaskList::AddToList(MTask *task, const char *type, MTask *where) 144 { 145 // FIXME: We agreed to put the task into list in an ordered way. 146 137 Bool_t MTaskList::CheckAddToList(MTask *task, const char *type, const MTask *where) const 138 { 147 139 // 148 140 // Sanity check … … 182 174 } 183 175 184 if (where) 185 { 186 if (!fTasks->FindObject(where)) 187 { 188 *fLog << err << dbginf << "Error: Cannot find task after which the new task should be scheduled!" << endl; 189 return kFALSE; 190 } 191 } 192 193 *fLog << inf << "Adding " << name << " to " << GetName() << " for " << type << "... " << flush; 194 176 if (!where) 177 return kTRUE; 178 179 if (fTasks->FindObject(where)) 180 return kTRUE; 181 182 *fLog << err << dbginf << "Error: Cannot find task after which the new task should be scheduled!" << endl; 183 return kFALSE; 184 } 185 186 187 // -------------------------------------------------------------------------- 188 // 189 // schedule task for execution, before 'where'. 190 // 'type' is the event type which should be processed 191 // 192 Bool_t MTaskList::AddToListBefore(MTask *task, const MTask *where, const char *type) 193 { 194 // FIXME: We agreed to put the task into list in an ordered way. 195 if (!CheckAddToList(task, type, where)) 196 return kFALSE; 197 198 *fLog << inf << "Adding " << task->GetName() << " to " << GetName() << " for " << type << "... " << flush; 199 task->SetStreamId(type); 200 fTasks->AddBefore((TObject*)where, task); 201 *fLog << "Done." << endl; 202 203 return kTRUE; 204 } 205 206 // -------------------------------------------------------------------------- 207 // 208 // schedule task for execution, after 'where'. 209 // 'type' is the event type which should be processed 210 // 211 Bool_t MTaskList::AddToListAfter(MTask *task, const MTask *where, const char *type) 212 { 213 // FIXME: We agreed to put the task into list in an ordered way. 214 215 if (!CheckAddToList(task, type, where)) 216 return kFALSE; 217 218 *fLog << inf << "Adding " << task->GetName() << " to " << GetName() << " for " << type << "... " << flush; 219 task->SetStreamId(type); 220 fTasks->AddAfter((TObject*)where, task); 221 *fLog << "Done." << endl; 222 223 return kTRUE; 224 } 225 226 // -------------------------------------------------------------------------- 227 // 228 // schedule task for execution, 'type' is the event type which should 229 // be processed 230 // 231 Bool_t MTaskList::AddToList(MTask *task, const char *type) 232 { 233 // FIXME: We agreed to put the task into list in an ordered way. 234 235 if (!CheckAddToList(task, type)) 236 return kFALSE; 237 238 *fLog << inf << "Adding " << task->GetName() << " to " << GetName() << " for " << type << "... " << flush; 195 239 task->SetStreamId(type); 196 240 fTasks->Add(task); 197 198 241 *fLog << "Done." << endl; 199 242 … … 325 368 *fLog << all << task->GetName() << "... " << flush; 326 369 327 if (CheckClassForProcess(task->IsA()))328 fTasksProcess.Add(task);329 330 370 // 331 371 // PreProcess the task and check for it's return value. … … 350 390 351 391 *fLog << all << endl; 392 393 Next.Reset(); 394 395 // 396 // loop over all tasks for preproccesing 397 // 398 while ((task=(MTask*)Next())) 399 if (CheckClassForProcess(task->IsA())) 400 fTasksProcess.Add(task); 352 401 353 402 return kTRUE; -
trunk/MagicSoft/Mars/mbase/MTaskList.h
r1540 r1661 35 35 void StreamPrimitive(ofstream &out) const; 36 36 37 Bool_t CheckAddToList(MTask *task, const char *tType, const MTask *where=NULL) const; 38 37 39 public: 38 40 MTaskList(const char *name=NULL, const char *title=NULL); … … 43 45 void SetLogStream(MLog *log); 44 46 45 Bool_t AddToList(MTask *task, const char *tType="All", MTask *where = NULL); 47 Bool_t AddToListBefore(MTask *task, const MTask *where, const char *tType="All"); 48 Bool_t AddToListAfter(MTask *task, const MTask *where, const char *tType="All"); 49 Bool_t AddToList(MTask *task, const char *tType="All"); 46 50 47 51 TObject *FindObject(const char *name) const;
Note:
See TracChangeset
for help on using the changeset viewer.