Schema evolution question

If I have a class that inherits from TNamed, with a data member that is another (user-defined) class, and I wish to rename that data member in a new version of the class, can I ensure correct backwards compatibility when reading in the older versions of the class without creating a hand-defined Streamer that sets the value of the new data member to the contents of the old one? I thought that’s what the new #pragma read command was for (and that I should include it in LinkDef.h used when compiling the dictionary containing the class in question). However, I can’t seem to figure out the correct syntax to make this actually work, and the references that I’ve found are a little sketchy. How do I get this to work without the compiler complaining about the old data member name being undefined, or leaving a “legacy” copy of the old data member name in the class definition? Do I specify the class versions prior to the renaming of the data member, or post? Does this even work when the data member is itself a user-defined class inheriting from TObject?

 Thanks,
         Amanda

Hi,

The following should work:#pragma read sourceClass="MyClass" targetClass="MyClass" source="SubClass fOldName" version="[8]" target="fNewName" \ code="{ fNewName = onfile. fOldName; }"

Cheers,
Philippe.