logo       

Re: SWIG-PERL-Vector of pointers: msg#00110

programming.swig

Subject: Re: SWIG-PERL-Vector of pointers

On 2003.11.17 18:36, "Nair, Sanjay S" wrote:
I written a small test class

%module SbsdSLI
%include "std_vector.i"

typedef struct Abcd {
int i;
short j;
} Abcd;

%template(Abcd_vector) std::vector<Abcd>;

class Test {
public:
void disable( std::vector<Abcd_vector>& abcdVector );
};

SWIG generated code only has 3 parameters ( unlike the int vector
which has 4)

static swig_type_info _swigt__p_Abcd_vector[] = {{"_p_Abcd_vector", 0,
"Abcd_vector &", 0},{"_p_Abcd_vector"},{0}};

I assume you support Vector of Structs right?

We do. However:

1) if I run SWIG on the module above I don't get the output you report. Names apart, I do get the same as for std::vector<int>. Are you processing the very same code you quoted above? With which version of SWIG? With which command-line arguments?

2) I don't mean to be rude, but why are you interested in the generated code at all? For practical purposes, that is the same as object code. Instead:

3) in which way does not the above "work"? Does it not compile? Does it not do what you expect in Perl? Can you post a minimal example which I can try to compile and run?

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