This took some time to implement, for a variety of reasons - making a class hierarchy, wrappers to handle the missing methods etc.
Unfortunately now that i’ve tried it, i’ve run into the same issue as this thread: Renamed class and error "trying to read an emulated class"
but only for classes which contain TObjArray
s of other renamed classes.
I have the corresponding lines for all renamed classes in my linkdef file, and everything works without any problems for renamed classes that don’t contain TObjArrays.
But for renamed classes that contain TObjArrays of another class, when I try to retrieve an entry from the branch, I get messages like the following:
Error in <TBufferFile::ReadObject>: trying to read an emulated class (MyOtherClass) to store in a compiled pointer (TObject)
To clarify, the situation is like this:
class MyClassA{
private:
TObjArray* theEvents;
...
public:
MyClassB* GetEvent(int i){ return (MyClassB*)(*theEvents[i]); }
}
class MyClassB{
...
}
now I have renamed MyClassA
to MyClassA_ver0
and MyClassB
to MyClassB_ver0
.
I can instantiate and use both new classes, and I can set the address of a tree branch holding a MyClassA
object to the address of a pointer to a MyClassA_ver0
object. So far so good. But on trying to do retrieval, i receive ReadObject errors about MyClassB
.
Is there something extra that needs to be done to support TObjArrays?