logo       

RE: SWIG-PERL-Vector of pointers: msg#00107

programming.swig

Subject: RE: SWIG-PERL-Vector of pointers

The code generation changed after I inserted struct keyword before the
vector declaration
struct BpDataStruct_SLI{
> long type;
> };
> typedef std::vector< struct BpDataStruct_SLI>
BpDataStruct_SLI_vector;

int ReadBp ( const Int_vector& vReadData,
> std::vector< struct BpDataStruct_SLI>& vReadData );

-sanjay

-----Original Message-----
From: Luigi Ballabio [mailto:luigi.ballabio@xxxxxxxxxxxxx]
Sent: Monday, November 17, 2003 9:30 AM
To: Nair, Sanjay S
Cc: luigi.ballabio@xxxxxxxxxxxxx; swig@xxxxxxxxxxxxxxx
Subject: Re: [Swig] SWIG-PERL-Vector of pointers

On 2003.11.17 17:49, "Nair, Sanjay S" wrote:
> I have the following swig code
>
> %module SbsdSLI
>
> %include "std_vector.i"
>
> %template (Int_vector) std::vector<int>;
> typedef std::vector<int> Int_vector;
>
> namespace SBSD {
>
> struct BpDataStruct_SLI{
> long type;
> };
> typedef std::vector<BpDataStruct_SLI> BpDataStruct_SLI_vector;
>
> class ItpBreakpointSLIProxy {
>
> int ReadBp ( const Int_vector& vReadData,
> BpDataStruct_SLI_vector& vReadData );
> };
> };

Well, you do have to instantiate the template. The directive

%template(BpDataStruct_SLI_vector) std::vector<SBSD::BpDataStruct_SLI>

should do the trick. If that fails, try

namespace SBSD {
%template(BpDataStruct_SLI_vector) std::vector<BpDataStruct_SLI>
}

> Also, do you support Vector of pointers in SWIG?

I'll have to check that.

Later,
Luigi
_______________________________________________
Swig maillist - Swig@xxxxxxxxxxxxxxx
http://mailman.cs.uchicago.edu/mailman/listinfo/swig



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise