[C++-sig] get_overload raising cannot convert from 'boost::python::detail::method_result' to 'MMOT::Geometry &'

Freyr Magnússon freyr.magnusson at gmail.com
Mon Sep 7 01:25:45 CEST 2009


I trying to create an interface wrapper for a class and I get an error:

cannot convert from 'boost::python::detail::method_result' to
'MMOT::Geometry &'

The code is like this:
struct SelectQueryWrap : SelectQuery, wrapper<SelectQuery>
{
    bool queryNodeBefore(QueryContext* context, OctreeNode *node, const
AABBox& region)
    {
        return this->get_override("queryNodeBefore")(context, node, region);
    }
    // removed working members
    // >>>>>>>>>>>>>>>>>>>>> this failes <<<<<<<<<<<<<<<<<<<
    Geometry& getGeometry()
    {
        return this->get_override("getGeometry")();
    }
};

Geometry is another wrapped interface which is working fine and is defined
like so:

struct GeometryWrap : Geometry, wrapper<Geometry>
{
    int intersectNode(const MMOT::AABBox &box)
    {
        return this->get_override("intersectNode")(box);
    }
    float volume() const
    {
        return this->get_override("volume")();
    }
    void prepare()
    {
        if (override prepare = this->get_override("prepare"))
            prepare();
        else
            Geometry::prepare();
    }
    void default_prepare() { this->Geometry::prepare(); }
};


I'm a bit lost here.  Can't I return a reference to the object or is my
wrapping getting too convoluted (well something is wrong anyway)?

Any help appreciated.

Freyr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20090906/c13f3ea0/attachment.htm>


More information about the Cplusplus-sig mailing list