From: Edward M. <pap...@gm...> - 2012-08-30 16:12:06
|
I have a class A that has been vectorized using std_vector.i. Once I create a vector of A, I want to pass it to a method of class B. My Python code looks like: a = new ex.VA b= new ex.B( "a", a, "unitY" ) And the exception that I get is: Traceback (most recent call last): File "/Users/efm/tmp/sv/test.py", line 38, in <module> "unitY" ) File "/Users/efm/build/SnowLeopard/sv/Example.py", line 399, in __init__ this = _Example.new_B(*args) NotImplementedError: Wrong number or type of arguments for overloaded function 'new_B'. Possible C/C++ prototypes are: B::B(std::string const &,std::vector< Example::A,std::allocator< Example::A > >,std::string const &) I have wrapped the vectorization of A with: class A { public }; %include <std_vector.i> namespace std { %template(VA) vector<A>; } class B { public: %extend { B( const std::string& Name, std::vector<A> As, const std::string& UnitY ) { return new FrVect( Name, As.size( ), &(As[ 0 ]), UnitY ); } } /* %extend */ } Thanks for any insight, Ed |