From: William S F. <ws...@fu...> - 2007-06-27 07:54:29
|
Nitro wrote: > I think in your case you can just remove the anonymous union declaration, > while leaving it's "body" intact. After that it would look like: > > class AMP_CXX_Export AmpOrderSiteSpecificFields_v2: public AsnType > { > public: > enum ChoiceIdEnum > { > nullCid = 0, > icapCid = 1, > pcxCid = 2 > }; > > enum ChoiceIdEnum choiceId; > > /// union causing the problem in SWIG ( hopefully not anymore :) ) > AmpNull* null; > AmpOrderIcapFields_v2* icap; > AmpOrderPCXFields* pcx; > > #if META > static const AsnChoiceTypeDesc desc_; > #endif // META > > AmpOrderSiteSpecificFields_v2(); > AmpOrderSiteSpecificFields_v2 (const AmpOrderSiteSpecificFields_v2 &); > ~AmpOrderSiteSpecificFields_v2(); > }; > > SWIG doesn't really care whether it's a union or not. > Or %include the original header file and add getters/setters for the union members back in like this: %extend AmpOrderSiteSpecificFields_v2 { void setNull( AmpNull* ampnull ) { $self->null = ampnull; } void setIcap( AmpOrderIcapFields_v2* icap ) { $self->icap = icap; } void setPcx( AmpOrderPCXFields* pcx ) { $self->pcx = pcx; } AmpNull* getNull() { return $self->null; } AmpOrderIcapFields_v2* getIcap() { return $self->icap; } AmpOrderPCXFields* getPcx() { return $self->pcx; } } William |