*refrased* Derived from exposed class in boost python

Started by
0 comments, last by CoMaNdore 16 years, 10 months ago
Hey Refased this post since I kinda dint get any reply's. Hopefully it will be easier to see what I ask about this time :)

// the source code:
class A
{
	public:
		A()
		{
			std::cout << "A()" << std::endl;
			m_Value = 0;
		}

		virtual ~A() { std::cout << "~A()" << std::endl; }

		virtual void foo() = 0;
		virtual int ghey() { return( m_Value ); }
		int m_Value;
};


class B : public A, public wrapper<A>
{
	public:
		B() { std::cout << "B()" << endl; m_Value = 133; }
		virtual ~B() { std::cout << "~B()" << endl; }

		virtual void foo()
		{
			this->get_override( "foo" )();
		}
};

class C : public B, public wrapper
{
	public:
		C() { std::cout << "C()" << endl; }
		virtual ~C() { std::cout << "~C()" << endl; }

		virtual int ghey() { return( m_Value*2 ); }
		int m_Value2;
};
And here is how it is exposed for boost python:

BOOST_PYTHON_MODULE( bpydebug )
{
	class_<B, boost::noncopyable>("B")
		.def( "foo", pure_virtual( &B::foo ) )
		.def_readwrite( "Value", &A::m_Value )
	;

	class_<C, noncopyable, bases >( "C" )
		.def_readwrite( "Value2", &C::m_Value2 )
	;
};
This code works if you uncomment everything in the 'class_' declaration (remove the .def_readwrite part of C). Any idea how to fix this? [Edited by - CoMaNdore on June 8, 2007 10:00:22 AM]
- Me
Advertisement
Any hints/links on boost::python debuging at all?
Please...
- Me

This topic is closed to new replies.

Advertisement