[xsd-users] xsd inheretance at generated code

Boris Kolpackov boris at codesynthesis.com
Sun Jun 10 05:11:41 EDT 2007


Hi Uri,

Uri Karagila <uri at hyperroll.com> writes:

> suggested option was already considered; yet, since we are not using
> RTTI (code performance reasons) and therefore dynamic_cast is forbidden.
> can you think of other options (beside updating xsd schema)?

You want to figure out the type of an object at runtime. The only way
to do this in C++ is by using RTTI (or a similar custom mechanism which
will most likely be less efficient than RTTI).

One way you can work around this situation is by customizing the types
involved to use virtual functions to perform the tasks you need. For an
example of this approach see the taxonomy example in the
examples/cxx/tree/custom directory.

Note, however, that the --generate-polymorphic option depends on RTTI
so I am not sure how useful the above approach will be to you.


hth,
-boris




More information about the xsd-users mailing list