|
How to return a std::vector of pointers to Java?: msg#00142programming.swig
Hi, I'm just getting started with SWIG as a Java to C++ bridge. I need to return a std::vector of pointers from C++ to Java and I'm stuck; the code below works beautifully, I just need to convert the values to pointers. namespace std { %template(VectorOfClassA) vector<ClassA>; }; class ClassA{ public: int amember; }; class ClassB{ public: // this is handled fine; why not in vectors? ClassA* createClassA(); // this works too but I want to avoid creating new objects // via the copy c'tor when adding to the vector. vector<ClassA> getClassAVector(); }; Can anybody help me change all of "vector<ClassA>" to "vector<ClassA*>", which I guess may need a new or improved typemap. Using the current std_vector.i typemap with the pointers generates a "VectorOfClassA.java" with a get() method that returns a "SWIGTYPE_p_p_ClassA" - I want it to return a "ClassA". Thanks for any advice. Henrietta _________________________________________________________________ Express yourself with cool new emoticons http://www.msn.co.uk/specials/myemo _______________________________________________ Swig maillist - Swig@xxxxxxxxxxxxxxx http://mailman.cs.uchicago.edu/mailman/listinfo/swig |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | i686,SWIG+Perl, segmentation fault when using C structures: 00142, Bryga 66 |
|---|---|
| Next by Date: | Java char *INOUT doesn't OUT: 00142, Gary Nissen |
| Previous by Thread: | i686,SWIG+Perl, segmentation fault when using C structuresi: 00142, Bryga 66 |
| Next by Thread: | Re: How to return a std::vector of pointers to Java?: 00142, William S Fulton |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |