[C++-sig] Assert fail during deletion for an obj containing external object ptr

Roman Yakovenko roman.yakovenko at gmail.com
Tue Sep 19 07:16:38 CEST 2006


On 9/19/06, Gangadhar NPK <npk.gangadhar at gmail.com> wrote:
> Hi Romanov,

My name is Roman, not Romanov.

> I am trying to learn Boost.python, so I might be wrong in the way I
> have written code. How, do you think should the same thing be codified
> ?

Try Py++ GUI.
http://language-binding.net/pyplusplus/documentation/tutorials/tutorials.html#graphical-interface

You don't have to learn any API.
This is the code Py++ generated for your ExternalLib class:

namespace bp = boost::python;

struct ExternalLib_wrapper : ExternalLib, bp::wrapper< ExternalLib > {

    ExternalLib_wrapper( )
    : ExternalLib( )
      , bp::wrapper< ExternalLib >()
    {   // Normal constructor

    }

};

BOOST_PYTHON_MODULE(pyplusplus){
    bp::class_< ExternalLib_wrapper, boost::noncopyable >(
"ExternalLib", bp::init< >() )
        .def(
            "Create"
            , &::ExternalLib::Create
                /* undefined call policies */ )
        .def(
            "Print"
            , &::ExternalLib::Print )
        .staticmethod( "Create" );
}

-- 
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/



More information about the Cplusplus-sig mailing list