Hello all,
I modified the rtiddsgen templates in a way so that I can use unions as storage for polymorphic objects.
To be able to do that I added every IDL C++ class a virtual dummy function to be able to use dynamic cast on these. But this causes RTI to segfault when reciving data. I assume that RTI does access directly the memory and because the memory layout of virtual objects is different to the memory layout of non virtual objects.
Is there a way to solve this?
Best regards,
Andreas
Hello,
Yes the code that we generate assumes that there are no virtual methods in the classes. I do not recall exactly why we introduced that limitation. I think it helps simplify some of the ContentFilterTopic and dynamic data algorithms that can use the same code for C and C++ types. This is an unfortunate side-effect.
I will file an internal issue to take evaluate if this constraint could be removed in future releases...
Gerardo
That is very unfortunate. One could implement polymorphism pretty nicely if this would be possible. With a little bit autogenerated idl code even fully automatic.
Now I have to use boost::variant which is much less nice.