[xsd-users] Inheritance : Ways to get the real type

Klaim - Joël Lamotte mjklaim at gmail.com
Tue Nov 29 17:12:20 EST 2011


2011/11/29 Bill Pringlemeir <bpringle at sympatico.ca>

> On 25 Nov 2011, mjklaim at gmail.com wrote:
>
> > I don't know if it's a common pattern but it seems that any tool I'll be
> > writing for this language will require some kind of function table to do
> > the right thing depending on the real type of some of my inherited types.
>
> An alternative solution is to use customization, wrap the class and use
> virtuals.  This is more work, but is probably most efficient.  You can
> automate the wrapping with a makefile that has some generic rules and
> possibly auto-generate the wrappers with some template code (not a C++
> template, but like 'Makefile.in', etc).
>
> Fwiw,
> Bill Pringlemeir.
>


As I said, I don't want to use such a solution because I need this feature
for specific use case and it just feels wrong to have to setup such
solution just to know the real type.
I'll go with the type_id solution, as I thought. I just hope I will not get
in a case where I need to use the lib in a context that doesn't allow RTTI.
But I guess it's more rare today.

Joël Lamotte


More information about the xsd-users mailing list