[C++-sig] Re: Exposing C++ objects to Python at runtime

Raoul Gough RaoulGough at yahoo.co.uk
Wed Nov 26 11:21:27 CET 2003


David Abrahams <dave at boost-consulting.com> writes:

> Raoul Gough <RaoulGough at yahoo.co.uk> writes:
>
>> David Abrahams <dave at boost-consulting.com> writes:
[snip]
>>> I've been trying to say that you you *can*, in principle, still do
>>> this with a single ScriptEngine type, so that registration code gets
>>> compiled once, scripting-language-independently.
>>
>> Given a certain amount of wrapper code to set up a "function
>> descriptor" object, I assume.
>
> Yup.

The only difficulty I've thought of would be handling return values.
For instance, somewhere you have to have a conversion from the C++
return type to a PyObject * (for the Python engine) or the
corresponding type for different engines. Maybe a double-dispatch
would handle this, meaning a certain amount of scripting language
dependant code in the function descriptor base class?

-- 
Raoul Gough.
export LESS='-X'





More information about the Cplusplus-sig mailing list