[C++-sig] reuse C++ classes that have been wrapped with SWIG

2010-07-15 Thread Marco Selinger
Dear all,
is it possible to reuse C++ classes in Boost.Python that have been wrapped with 
SWIG?

There is a complete SWIG wrapper for the OpenCV 
(http://opencv.willowgarage.com) 
project.

I am developing a small image processing application that uses some of the 
OpenCV classes. This application will be wrapped using Boost.Python.
How do I declare those classes in Boost.Python that have already been wrapped 
with SWIG?

For example, there is a method in my application that returns an instance of 
CvArr. The wrapper must recognize that the returned CvArr is the same as the 
CvArr wrapped by SWIG, so that all CvArr methods can be called on this instance.

Thank you
Marco


___
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig

Re: [C++-sig] reuse C++ classes that have been wrapped with SWIG

2010-07-15 Thread Ralf W. Grosse-Kunstleve
Yes, should be possible, although I haven't tried it in a long time, but here 
are 

some old files that may still work:

http://cctbx.svn.sourceforge.net/viewvc/cctbx/trunk/boost_adaptbx/

swig_arg.hpp
swig_args_ext.cpp
tests/tst_swig_args.py
SConscript

In the SConscript look for "swig".
___
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig


[C++-sig] Project architecture and Py++

2010-07-15 Thread Pentix

Hi,

I’d like to use Python in the following way:

1) create a library (pyd) with some interfaces of the main program taken
outside; generate then its code with py++
2) create a set of scripts, that use this library
3) execute these scripts with boost::python from the main program

Unwillingness to carry out any manual corrections of the generated code is
an important part of the solution. The code is being generated
authomatically, and only the script and the imported header are to be
corrected in case of any problem. It is motivated by the fact, that
the program is developing dynamically and it is better to see and solve
immedeately the emerging discrepancies.

Thus, the main task of implementation phase been solved already, but there
arose the following problem: there appeared a desire to transfer
into python our objects (from those being exposed). But all wrappers are
being generated into the library from the point 1, and are in the
cpp files. 

I’m ready to make the dependance of the main module on the library. But how
to get the wrappers, if it is undesirable to correct the generated code
manually?

Thanks,
Alex
-- 
View this message in context: 
http://old.nabble.com/Project-architecture-and-Py%2B%2B-tp29179641p29179641.html
Sent from the Python - c++-sig mailing list archive at Nabble.com.

___
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig