[xsde-users] Re: Determine whether an object model supports polymorphism

Boris Kolpackov boris at codesynthesis.com
Tue Oct 20 09:24:31 EDT 2009


Hi Thomas,

Thomas Frenzel (TomSun) <tftomsun at streamteam.de> writes:

> is there any possibility to determine whether a xml object model has 
> been generated with polymorphism support? I would like to have a static 
> bool on the generated object model or the generated parser/serializer 
> classes. Something like:
> 
> bool MyGeneratedRoot.SupportsPolymorphism()
> 
> or bool MyGeneratedRoot_paggr.SupportsPolymorphism()

No, there is no such thing at the moment. The closest you can get is
to check for the XSDE_POLYMORPHIC macro which indicates that the
runtime library has been built with polymorphism support. However,
it is still possible to compile the schemas without polymorphism
support by specifying the --runtime-polymorphic option instead of
--generate-polymorphic.

I am also having a hard time imagining where would such a test be
useful. I can see where checking if a particular type (as opposed
to the whole object model) is polymorphic can be useful. Can you
tell us a bit more about what you are trying to achieve?

> Btw. you wanted to provide a beta version including the code 
> generation of enumerations. I am still interested in that beta. :)

I sent an email outlining the design and asked for feedback but
haven't heard back. So I figured that you must have gotten pulled
into something else. Perhaps the email just got lots. Here it is 
in the archives:

http://www.codesynthesis.com/pipermail/xsde-users/2009-October/000158.html

If you can let me know what you think, I can go ahead and implement
this.

Boris



More information about the xsde-users mailing list