-
Notifications
You must be signed in to change notification settings - Fork 18.5k
boost.python wrapper, why? #1651
Copy link
Copy link
Closed
Labels
Description
I don't quite understand the logic of using PyBlobWrap, can someone explain to me please?
// We need another wrapper (used as boost::python's HeldType) that receives a
// self PyObject * which we can use as ndarray.base, so that data/diff memory
// is not freed while still being used in Python.
class PyBlobWrap : public PyBlob {
public:
PyBlobWrap(PyObject *p, const PyBlob &blob)
: PyBlob(blob), self_(p) {}
bp::object get_data();
bp::object get_diff();
private:
PyObject *self_;
};
Reactions are currently unavailable