[C++-sig] Type conversion problem -- simplified

Randall Hopper viznut at charter.net
Sat Nov 4 01:41:30 CET 2006


     I've been digging into this and can summarize the problem more
succinctly now (I was barking up the wrong tree before).

     What do I need to do to tell boost::python to dereference a wrapped
C++ pointer before trying to invoke the C++ class instance's methods?

     I've got a method returning a pointer to a C++ class instance, and
right now I can't use it as a callable because boost::python treats it like
a pointer.

Traceback (most recent call last):
  ...
  File "osg_to_sgg.py", line 153, in setupGeode
    v[0].set( 0, 1, 2 )
Boost.Python.ArgumentError: Python argument types in
    Vec3Array.__getitem__(Vec3Array, int)
did not match C++ signature:
    __getitem__(osg::TemplateArray<osg::Vec3f, (osg::Array::Type)10, 3, 5126>*, int)

Note that the Vec3Array type is identical to the osg::TemplateArray<...>
type (via typedef), so the key difference is the extra "*" in the last
line.

Thanks,
 
Randall



More information about the Cplusplus-sig mailing list