Changeset 1003 for trunk/MagicSoft/Mars/mbase/MParList.cc
- Timestamp:
- 10/29/01 11:15:53 (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MParList.cc
r986 r1003 43 43 #include <TNamed.h> 44 44 #include <TClass.h> 45 #include <TO bjArray.h>45 #include <TOrdCollection.h> 46 46 47 47 #include "MLog.h" … … 57 57 MParList::MParList(const char *name, const char *title) 58 58 { 59 *fName = name ? name : "MParList";60 *fTitle = title ? title : "A list of Parameter Containers";59 fName = name ? name : "MParList"; 60 fTitle = title ? title : "A list of Parameter Containers"; 61 61 62 62 // … … 64 64 // that the destructor of the list deletes all it's objects 65 65 // 66 fAutodelete.SetOwner(); 66 fContainer = new TOrdCollection; 67 fAutodelete = new TOrdCollection; 68 69 fAutodelete->SetOwner(); 67 70 } 68 71 … … 76 79 MParList::MParList(MParList &ts) 77 80 { 78 fContainer .AddAll(&ts.fContainer);81 fContainer->AddAll(ts.fContainer); 79 82 } 80 83 … … 87 90 { 88 91 if (TestBit(kIsOwner)) 89 fContainer.SetOwner(); 92 fContainer->SetOwner(); 93 94 delete fContainer; 95 delete fAutodelete; 90 96 } 91 97 … … 107 113 void MParList::SetLogStream(MLog *log) 108 114 { 109 TIter Next( &fContainer);115 TIter Next(fContainer); 110 116 111 117 MParContainer *cont=NULL; … … 143 149 // Check if the new container is already existing in the list 144 150 // 145 const TObject *objn = fContainer .FindObject(name);146 const TObject *objt = fContainer .FindObject(cont);151 const TObject *objn = fContainer->FindObject(name); 152 const TObject *objt = fContainer->FindObject(cont); 147 153 148 154 if (objn || objt) … … 172 178 if (where) 173 179 { 174 if (!fContainer .FindObject(where))180 if (!fContainer->FindObject(where)) 175 181 { 176 182 *fLog << dbginf << "Error: Cannot find parameter container after which the new one should be added!" << endl; … … 181 187 *fLog << "Adding " << name << " to " << GetName() << "... " << flush; 182 188 183 fContainer .Add(cont);189 fContainer->Add(cont); 184 190 *fLog << "Done." << endl; 185 191 … … 204 210 while ((cont=(MParContainer*)Next())) 205 211 { 206 // 212 AddToList(cont); 213 /* // 207 214 // Get Name of new container 208 215 // … … 212 219 // Check if the new container is already existing in the list 213 220 // 214 const TObject *objn = fContainer .FindObject(name);215 const TObject *objt = fContainer .FindObject(cont);221 const TObject *objn = fContainer->FindObject(name); 222 const TObject *objt = fContainer->FindObject(cont); 216 223 217 224 if (objn || objt) … … 237 244 *fLog << "Adding " << name << " to " << GetName() << "... " << flush; 238 245 239 fContainer .Add(cont);240 241 *fLog << "Done." << endl; 246 fContainer->Add(cont); 247 248 *fLog << "Done." << endl;*/ 242 249 } 243 250 } … … 250 257 TObject *MParList::FindObject(const char *name) const 251 258 { 252 return fContainer .FindObject(name);259 return fContainer->FindObject(name); 253 260 } 254 261 … … 259 266 TObject *MParList::FindObject(TObject *obj) const 260 267 { 261 return fContainer .FindObject(obj);268 return fContainer->FindObject(obj); 262 269 } 263 270 … … 358 365 // if object is not existing in the list try to create one 359 366 // 360 *fLog << dbginf << "Object '" << oname << "' [" << cname << "] not found... creating." << endl;367 *fLog << "Object '" << oname << "' [" << cname << "] not yet in " << GetName() << "... creating." << endl; 361 368 362 369 // … … 393 400 // object is deleted together with the list 394 401 // 395 fAutodelete .Add(pcont);402 fAutodelete->Add(pcont); 396 403 397 404 // … … 419 426 void MParList::SetReadyToSave(Bool_t flag) 420 427 { 421 TIter Next( &fContainer);428 TIter Next(fContainer); 422 429 423 430 MParContainer *cont=NULL; … … 438 445 void MParList::Reset() 439 446 { 440 TIter Next( &fContainer);447 TIter Next(fContainer); 441 448 442 449 MParContainer *cont=NULL;
Note:
See TracChangeset
for help on using the changeset viewer.