Hi all.
I’d really like to use multiple virtual inheritance in my data structure classes. I have been trying to do the following:
class Base {
…
}
class Event : public virtual Base {
…
}
fillTree{
TTree *t = new Tree(…);
Event *e = new Event();
t->Branch(“eventBranch”, “Event”, &e, 32000, 99);
//loop and fill some Event members
t->Write();
}
My code compiles, but always breaks at the TTree::Branch. If I do not virtually inherit class Base, then it completely works fine.
Can anybody tell me what I’m doing wrong? Or is this a ROOT limitation?
The output from gdb that I get at this line is:
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000028
0x00000001000036c9 in G__EventDict_146_0_26 ()
Thanks for your help.
Adam
ps - yes, I know that there is not any multiple inheritance at this point, but there would be if I could first get this to work.