Changeset 1187
- Timestamp:
- 01/16/02 13:29:10 (23 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r1186 r1187 10 10 * manalysis/MMcPedestalNSBAdd.cc: 11 11 - small changes to output 12 13 * mbase/MParList.[h,cc]: 14 - added FindObject with class type argument 15 16 * mbase/MWriteAsciiFile.cc 17 - replaced call to InheritsFrom by new FindObject 12 18 13 19 -
trunk/MagicSoft/Mars/mbase/MParList.cc
r1117 r1187 234 234 // -------------------------------------------------------------------------- 235 235 // 236 // Find an object in the list and check for the correct inheritance. 237 // 'name' is the name of the object you are searching for. 238 // 239 TObject *MParList::FindObject(const char *name, const char *classname) const 240 { 241 TObject *obj = fContainer->FindObject(name); 242 243 if (!obj) 244 return NULL; 245 246 if (obj->InheritsFrom(classname)) 247 return obj; 248 249 *fLog << dbginf << warn << "Found object '" << name << "' doesn't "; 250 *fLog << "inherit from " << "'" << classname << "'" << endl; 251 return NULL; 252 } 253 254 // -------------------------------------------------------------------------- 255 // 256 // check if the object is in the list or not and check for the correct 257 // inheritance 258 // 259 TObject *MParList::FindObject(const TObject *obj, const char *classname) const 260 { 261 TObject *nobj = fContainer->FindObject(obj); 262 263 if (!nobj) 264 return NULL; 265 266 if (nobj->InheritsFrom(classname)) 267 return nobj; 268 269 *fLog << dbginf << warn << "Found object '" << nobj->GetName() << "' "; 270 *fLog << "doesn't inherit from " << "'" << classname << "'" << endl; 271 return NULL; 272 } 273 274 // -------------------------------------------------------------------------- 275 // 236 276 // returns the ClassName without anything which is behind that last ';' in 237 277 // string. -
trunk/MagicSoft/Mars/mbase/MWriteAsciiFile.cc
r1182 r1187 176 176 const char *name = obj->GetName(); 177 177 178 MParContainer *cont = (MParContainer*)pList->FindObject(name );178 MParContainer *cont = (MParContainer*)pList->FindObject(name, "MParContainer"); 179 179 if (!cont) 180 180 { … … 183 183 } 184 184 185 if (!cont->InheritsFrom(MParContainer::Class()))186 {187 *fLog << err << dbginf << "'" << name << "' doesn't inherit from MParContainer." << endl;188 return kFALSE;189 190 }191 192 185 AddContainer(cont); 193 186 }
Note:
See TracChangeset
for help on using the changeset viewer.