[C++-sig] Boost.Python call policies at runtime...
icsa
investtcartier at yahoo.com
Thu Nov 9 18:23:13 CET 2006
Hi Stefan,
My apologies for the confusion. T is a C++ class. The crux of my issue is
that I need to extract variant data from a C++ object and return the data
using a return policy that is based on the type (at runtime).
Kevin
Stefan Seefeld wrote:
>
> Kevin Jones wrote:
>> Hi all,
>>
>> Given a class called Variant that can (at runtime)
>> contain either an int or a T*.
>>
>> I.E.
>> class Variant {
>> public:
>> int type;
>> union {
>> int i;
>> T* t;
>> };
>> };
>
> What is 'T' ?
>
>> How can I create a call policy that uses
>> return_by_value when Variant is an int or
>> manage_new_object when Variant is a T* (based on the
>> value of "type" at runtime)?
>
> What do you want to call that returns either of the two ?
>
>> Note: I need to wrap either the int as a python object
>> or T* as a python object and not Variant.
>
> You have given far too little information about what you
> want to do (both in C++ as well as python) for anybody to
> be able to help.
>
>
> Regards,
> Stefan
>
> --
>
> ...ich hab' noch einen Koffer in Berlin...
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig
>
>
--
View this message in context: http://www.nabble.com/-C%2B%2B-sig--Boost.Python-call-policies-at-runtime...-tf2602653.html#a7262368
Sent from the Python - c++-sig mailing list archive at Nabble.com.
More information about the Cplusplus-sig
mailing list