You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had a class containing a pointer to one of our classes and had to turn this pointer into a pointer to one of its base-class, eg:
Old: class A { TNamed *a; }
New: class A { TObject *a; }{code}
Now I get the following message reading a root file in which I stored an object of the old class with the new class in the dictionary: Warning in <TStreamerInfo:BuildOld>: Cannot convert A::a from type:TNamed* to type TObject, skip element.
It should be easy to detect that TObject is a base class of TNamed (and both are in the dictionary) so reading the object and setting the pointer correctly should not be very difficult. And would allow simple changes to your classes without loosing compatibility.
The text was updated successfully, but these errors were encountered:
Automating this would (probably) require to create a new TStreamerInfoAction that captures as part of its configuration the base class offset needed to adjust the pointer (e.g. for cases where there derived class inherited from multiple base classes). Special care would need to be given to the case of diamond and virtual inheritance.
See https://sft.its.cern.ch/jira/browse/ROOT-871?jql=project%20%3D%20ROOT%20AND%20status%20in%20(Open%2C%20%22In%20Progress%22%2C%20Reopened)%20ORDER%20BY%20created%20ASC
I had a class containing a pointer to one of our classes and had to turn this pointer into a pointer to one of its base-class, eg:
Now I get the following message reading a root file in which I stored an object of the old class with the new class in the dictionary:
Warning in <TStreamerInfo:BuildOld>: Cannot convert A::a from type:TNamed* to type TObject, skip element.
It should be easy to detect that
TObject
is a base class ofTNamed
(and both are in the dictionary) so reading the object and setting the pointer correctly should not be very difficult. And would allow simple changes to your classes without loosing compatibility.The text was updated successfully, but these errors were encountered: