[C++-sig] leaving out functions when exposing a class

FoxMulder900 foxmulder900 at yahoo.com
Fri Jul 11 22:51:49 CEST 2008


Hello, i am just starting to use boost python in my project. I am wrapping
one of my rather large classes that I want to be available in script.
However, there is only a small number of functions that I need to be
available in python, it was my understanding that I would not have to wrap
every function. Is this correct? When I run bjam, it gives me unresolved
external errors on the functions I did not wrap. If it is possible to leave
out functions, is there something extra I have to do?

I also have a second, slightly less significant question, How exactly do I
wrap deconstructors? I have the following code and it does not wrap
correctly.

BOOST_PYTHON_MODULE(pyGameObject)
{
	class_<GameObject>("GameObject", no_init)
		.def("~GameObject", &GameObject::~GameObject)
		.def("update", &GameObject::update)
		.def("translate", &GameObject::translate)
		.def("rotate", &NPC::rotate)
		.def("scale", &NPC::scale)
		.def("showBoundingBox", &NPC::showBoundingBox)
		.def("addChild", &NPC::addChild)
		
	;
}

Thanks in advance!
-- 
View this message in context: http://www.nabble.com/leaving-out-functions-when-exposing-a-class-tp18412325p18412325.html
Sent from the Python - c++-sig mailing list archive at Nabble.com.




More information about the Cplusplus-sig mailing list