[xsd-users] no abstract base classes with "Customizing the generated type — the complex case"

Boris Kolpackov boris at codesynthesis.com
Thu Jul 31 04:09:26 EDT 2014


Hi Oliver,

Oliver Schneider <xsd-users at oli-obk.de> writes:

> Aren't the *_base classes of complex types required to have a derived
> class, even without any abstract (base) classes around?
> Or would it be legal to define the _impl class without any base class
> and just implement the constructors?

Yes, exactly. The "base" in type customization means something to base
your implementation on, not necessarily base class as in inheritance.
You could, for example, use the generated implementation as a data member
in your custom implementation.


> I just manually edited the person.cxx and .hxx files. I made all the
> _clone functions in the .hxx file pure virtual, and removed the
> implementation in the cxx file, works like a charm.

I am still not clear what problem we are trying to solve here. The
generated "base" implementations for customized types are not used
directly anywhere in the generated code. I also don't see how anyone
can easily mix the "base" implementation for a custom one -- after
all the base implementation normally has a special name format (for
example, the '_base' suffix). If you wanted to, you could make it
even clearer: '_base_implementation_do_not_use_directly' ;-).

Is it maybe forgetting to implement _clone() that's the problem?

Boris



More information about the xsd-users mailing list