Changeset 1003 for trunk/MagicSoft/Mars/mbase/MTaskList.cc
- Timestamp:
- 10/29/01 11:15:53 (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MTaskList.cc
r988 r1003 47 47 #include "MTaskList.h" 48 48 49 #include <TOrdCollection.h> 50 49 51 #include "MLog.h" 50 52 #include "MLogManip.h" … … 63 65 MTaskList::MTaskList(const char *name, const char *title) 64 66 { 65 *fName = name ? name : "MTaskList"; 66 *fTitle = title ? title : "A list for tasks to be executed"; 67 fName = name ? name : "MTaskList"; 68 fTitle = title ? title : "A list for tasks to be executed"; 69 70 fTasks = new TOrdCollection; 67 71 } 68 72 … … 75 79 MTaskList::MTaskList(MTaskList &ts) 76 80 { 77 fTasks .AddAll(&ts.fTasks);81 fTasks->AddAll(ts.fTasks); 78 82 } 79 83 … … 86 90 { 87 91 if (TestBit(kIsOwner)) 88 fTasks.SetOwner(); 92 fTasks->SetOwner(); 93 94 delete fTasks; 89 95 } 90 96 … … 110 116 // create the Iterator over the tasklist 111 117 // 112 TIter Next( &fTasks);118 TIter Next(fTasks); 113 119 114 120 MTask *task=NULL; … … 147 153 // Check if the new task is already existing in the list 148 154 // 149 const TObject *objn = fTasks .FindObject(name);150 const TObject *objt = fTasks .FindObject(task);155 const TObject *objn = fTasks->FindObject(name); 156 const TObject *objt = fTasks->FindObject(task); 151 157 152 158 if (objn || objt) … … 165 171 // Otherwise add it to the list, but print a warning message 166 172 // 167 *fLog << dbginf << "Warning: Task with the same name'" << task->GetName();173 *fLog << dbginf << "Warning: Task '" << task->GetName(); 168 174 *fLog << "' already existing in '" << GetName() << "'." << endl; 169 175 *fLog << "You may not be able to get a pointer to this task by name." << endl; … … 172 178 if (where) 173 179 { 174 if (!fTasks .FindObject(where))180 if (!fTasks->FindObject(where)) 175 181 { 176 182 *fLog << dbginf << "Error: Cannot find task after which the new task should be scheduled!" << endl; … … 182 188 183 189 task->SetStreamId(type); 184 fTasks .Add(task);190 fTasks->Add(task); 185 191 186 192 *fLog << "Done." << endl; … … 196 202 TObject *MTaskList::FindObject(const char *name) const 197 203 { 198 return fTasks .FindObject(name);204 return fTasks->FindObject(name); 199 205 } 200 206 … … 205 211 TObject *MTaskList::FindObject(TObject *obj) const 206 212 { 207 return fTasks .FindObject(obj);213 return fTasks->FindObject(obj); 208 214 } 209 215 … … 221 227 // create the Iterator over the tasklist 222 228 // 223 TIter Next( &fTasks);229 TIter Next(fTasks); 224 230 225 231 MTask *task=NULL; … … 260 266 // create the Iterator for the TaskList 261 267 // 262 TIter Next( &fTasks);268 TIter Next(fTasks); 263 269 MTask *task=NULL; 264 270 … … 271 277 // if the task has the wrong stream id skip it. 272 278 // 273 if ( strcmp(GetStreamId(), task->GetStreamId()) &&274 strcmp(task->GetStreamId(), "All"))279 if (GetStreamId() != task->GetStreamId() && 280 task->GetStreamId() != "All") 275 281 continue; 276 282 … … 331 337 // create the Iterator for the TaskList 332 338 // 333 TIter Next( &fTasks);339 TIter Next(fTasks); 334 340 335 341 MTask *task=NULL; … … 377 383 // create the Iterator for the TaskList 378 384 // 379 TIter Next( &fTasks);385 TIter Next(fTasks); 380 386 381 387 MTask *task=NULL; … … 396 402 *fLog << "TaskList: " << GetName() << " <" << GetTitle() << ">" << endl; 397 403 398 fTasks .Print();404 fTasks->Print(); 399 405 400 406 *fLog << endl;
Note:
See TracChangeset
for help on using the changeset viewer.