Changeset 3666 for trunk/MagicSoft/Mars/mbase/MParContainer.cc
- Timestamp:
- 04/06/04 13:41:56 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MParContainer.cc
r3574 r3666 407 407 TMethodCall *MParContainer::GetterMethod(const char *name) const 408 408 { 409 TClass *cls = IsA()->GetBaseDataMember(name); 409 const TString n(name); 410 const Int_t pos1 = n.First('.'); 411 412 const TString part1 = pos1<0 ? n : n(0, pos1); 413 const TString part2 = pos1<0 ? TString("") : n(pos1+1, n.Length()); 414 415 TClass *cls = IsA()->GetBaseDataMember(part1); 410 416 if (cls) 411 417 { 412 TDataMember *member = cls->GetDataMember( name);418 TDataMember *member = cls->GetDataMember(part1); 413 419 if (!member) 414 420 { 415 *fLog << err << "Datamember '" << name<< "' not in " << GetDescriptor() << endl;421 *fLog << err << "Datamember '" << part1 << "' not in " << GetDescriptor() << endl; 416 422 return NULL; 423 } 424 425 // This handles returning references of contained objects, eg 426 // class X { TObject fO; TObject &GetO() { return fO; } }; 427 if (!member->IsBasic() && !part2.IsNull()) 428 { 429 cls = gROOT->GetClass(member->GetTypeName()); 430 if (!cls) 431 { 432 *fLog << err << "Datamember " << part1 << " ["; 433 *fLog << member->GetTypeName() << "] not in dictionary." << endl; 434 return NULL; 435 } 436 if (!cls->InheritsFrom(MParContainer::Class())) 437 { 438 *fLog << err << "Datamember " << part1 << " ["; 439 *fLog << member->GetTypeName() << "] does not inherit from "; 440 *fLog << "MParContainer." << endl; 441 return NULL; 442 } 443 444 const MParContainer *sub = (MParContainer*)((ULong_t)this+member->GetOffset()); 445 return sub->GetterMethod(part2); 446 } 447 448 if (member->IsaPointer()) 449 { 450 *fLog << warn << "Data-member " << part1 << " is a pointer..." << endl; 451 *fLog << dbginf << "Not yet implemented!" << endl; 452 //TClass *test = gROOT->GetClass(member->GetTypeName()); 453 return 0; 417 454 } 418 455 … … 422 459 } 423 460 424 *fLog << warn << "No standard access for '" << name<< "' in ";461 *fLog << warn << "No standard access for '" << part1 << "' in "; 425 462 *fLog << GetDescriptor() << " or one of its base classes." << endl; 426 463 … … 428 465 429 466 *fLog << warn << "Trying to find MethodCall '" << ClassName(); 430 *fLog << "::Get" << name<< "' instead <LEAKS MEMORY>" << endl;431 call = new TMethodCall(IsA(), (TString)"Get"+ name, "");467 *fLog << "::Get" << part1 << "' instead <LEAKS MEMORY>" << endl; 468 call = new TMethodCall(IsA(), (TString)"Get"+part1, ""); 432 469 if (call->GetMethod()) 433 470 return call; … … 436 473 437 474 *fLog << warn << "Trying to find MethodCall '" << ClassName(); 438 *fLog << "::" << name<< "' instead <LEAKS MEMORY>" << endl;439 call = new TMethodCall(IsA(), name, "");475 *fLog << "::" << part1 << "' instead <LEAKS MEMORY>" << endl; 476 call = new TMethodCall(IsA(), part1, ""); 440 477 if (call->GetMethod()) 441 478 return call; … … 443 480 delete call; 444 481 445 *fLog << err << "Sorry, no getter method found for " << name<< endl;482 *fLog << err << "Sorry, no getter method found for " << part1 << endl; 446 483 return NULL; 447 484 }
Note:
See TracChangeset
for help on using the changeset viewer.