On 06/25/2009 04:52 PM, Simon Pickles wrote:

However, what if I want to pass a c++ type to a python class? Is there some way to covnert my class, Logger in this case, to an bpy object, or some other way?

Yes, and this conversion happens implicitly, by virtue of the converter that has been created via class_<>.

So, the straight-forward way to do this is:

Logger *logger = ...;
bpl::object l = bpl::ptr(logger);

(the ptr() wrapper tells bpl that you want in fact pass by pointer. Without it, bpl makes a copy.)

Regards,
        Stefan

--

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

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

Reply via email to