Hi i'm using a boost python. There is an python object which was made by my c++ class.
like
python::class_<RectObject> Embedded_RectObject("RectObject");
Embedded_RectObject.def(init<RectObject>(int,int,int,int));
Embedded_RectObject.def_readwrite(TopX, &RectObject.TopX);
And i create that object at run time in python.
RectData = RectObject(10,10,10,10);
Now i want to register(add) below python method to 'RectData' which is python side object.
#return my member which name is TopX
def GetTopX():
return self.TopX
I want to register when it is a runtime. My system that user can access by python script. my system will support all available functions or class to users. And the system must support the user's custom method to object, so i need register python method to object at runtime.
(I want to do this c++ side code that register python method to python object at run time registration. Because my system will read user's custom python script files and register it to python object (EX: RectObject) )
How should i do it?