I am trying to port a Python class to C ++ using boost :: python with the hope of speeding up the execution of a Python application (the class that I am migrating to C ++ is responsible for ~ 30% of the application execution time).
The initialization of the Python source class looks like this:
class PyClass(object):
def __init__(self, child):
child.set_parent(self)
...
How do I replicate this in a C ++ constructor?
if I have a C ++ class:
class CClass
{
CClass(boost::python::object &child)
{
CClass& c = boost::python::extract<CClass&>(child);
c.set_parent(self);
}
...
}
Thanks Mark
source
share