[xsd-users] Constructors
Boris Kolpackov
boris at codesynthesis.com
Sun Feb 26 09:02:10 EST 2006
Jean-Francois,
Jean-Francois Dube <jf at magnu.polymtl.ca> writes:
> Would it be possible for the derived object to receive a base class
> object as argument at construction.
>
> For instance, in the polymorphism example, the superman_type class would
> also have the following for constructor:
>
> superman_type (person_type const&, can_fly::type const&);
Yes, I think we can add an option to generate this c-tor in addition
to the ones already there.
> Also, is there a reason to prevent the generated handlers from having a
> default constructor?
>
> I understand that the current constructors prevent us from generating
> incomplete objects (per schema),
Yes, that's the reason default c-tors are not generate for some types.
> but it would be convenient to be able
> to transfert all data to the xsd handlers using the standard accessors.
>
> It the previous example, it would have given the option of creating an
> empty superman_type (using the default contructor) outside of the
> wrapper and to pass it by reference to the wrapper (where it could be
> filled using the accessors).
>
> I also suspect that the constructor calls can become quite confusing for
> large objects.
I don't see a reason why we can't have an option to always generate
default c-tors for types.
I can add these two options and build you a binary. Just let me know which
platform(s)/package(s) you use.
hth,
-boris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: Digital signature
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060226/0f7e216c/attachment.pgp
More information about the xsd-users
mailing list