Hello,
You have to declare templates in your swig file:
%include "stl.i"
%template(AnotherClassVector) std::vector<AnotherClass>;
Cédric
Mohammed Rashad-3 wrote:
>
> Hi All,
>
> As a part of gsoc 2012 i had to use python bindings for OSSIM[1] . But I
> have some problem using it.
>
> i have a class in c++ whose constructor accepts a stl vector
>
> MyClass(std::vector<AnotherClass> &ac)
>
> how can i pass python list/tuple tothis function
> so the python code looks like this
> mylist = list()
> mylist.append(AnotherClass_instance)
> MyClass(mylist)
>
>
>
> [1] ossim.org
>
>
>
> --
> Regards,
> Rashad
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Swig-user mailing list
> Swig-user@...
> https://lists.sourceforge.net/lists/listinfo/swig-user
>
>
--
View this message in context: http://old.nabble.com/python-list-to-std%3A%3Avector%3CObject%3E-tp34039624p34044450.html
Sent from the swig-user mailing list archive at Nabble.com.
|