Thank you Stefan,
the typemaps are required, when C++ functions are wrapped that expect arguments 
which have no direct corresponding type in python, or when standard types have 
to be interpreted differently.

For example a function void parse_args(int argc, char **argv), which I want to 
call in python as mymodule.parse_args(["arg1","arg2","arg3"]). The wrapper 
would have to 
- count the number of python list items and pass this as argc to the C++ 
function
- allocate and fill a list of char* with the strings from the python list.
I need even more complicated conversions that are not provided by boost.python.

If it is still unclear, I'll try to give more examples. I know that I'm not 
expressing things very clear, because I have only a basic knowledge of 
boost.python.

Mihail


________________________________
Von: Stefan Seefeld <[EMAIL PROTECTED]>
An: Development of Python/C++ integration <cplusplus-sig@python.org>
Gesendet: Sonntag, den 30. November 2008, 20:29:41 Uhr
Betreff: Re: [C++-sig] Pyste,Py++: equivalent of swig typemaps?

Mihail Konstantinov wrote:
> Hello,
> due to limitations of swig I am currently learning Py++ and Pyste (because it 
> seems currently to be better documented than Py++).
> 
> Does Pyste or Py++ offer typemaps like swig 
> (http://www.swig.org/Doc1.3/SWIGDocumentation.html#Python_nn53) that allow 
> any sequence of input arguments to be wrapped to other Python arguments (like 
> for example ...,int len,char *s,.... to a Python string) in any function 
> where they appear, even surrounded by other arguments?

I'm not entirely sure I understand the question. boost.python provides 
to-python and from-python converters that seem to be equivalent to the 
'typemap' you are referring to. These converters are generated automatically 
for C++ types you export to python (
http://www.boost.org/doc/libs/1_37_0/libs/python/doc/tutorial/doc/html/python/exposing.html),
 so the conversion will happen automatically when you pass such a C++ type to a 
python function.

You may start with reading the boost.python tutorial 
(http://www.boost.org/doc/libs/1_37_0/libs/python/doc/tutorial/doc/html/index.html),
 as it explains this as well as many more features of boost.python. Py++ and 
Pyste are just tools that generate boost.python wrapper code automatically.

HTH,
      Stefan


-- 
     ...ich hab' noch einen Koffer in Berlin...

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



      

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

Reply via email to