#include <PyROOTPickle.h>
Definition at line 47 of file PyROOTPickle.h.
◆ Initialize()
void RootUtils::PyROOTPickle::Initialize |
( |
PyObject * |
libpyroot_pymodule, |
|
|
PyObject * |
cppinstance_pytype |
|
) |
| |
|
static |
Install the pickling of ObjectProxy's functionality.
Install the pickling of CPPInstance's functionality.
- Parameters
-
libpyroot_pymodule | The libPyROOT python module |
objectproxy_pytype | The ObjectProxy python type |
libpyroot_pymodule | The libPyROOT python module |
CPPInstance_pytype | The CPPInstance python type |
Definition at line 112 of file PyROOTPickle.cxx.
114 Py_INCREF( libpyroot_pymodule );
115 PyTypeObject* pytype = (PyTypeObject*)cppinstance_pytype;
118 static PyMethodDef s_pdefExp = { (
char*)
"_ObjectProxy__expand__",
121 PyObject* pymname = PyUnicode_FromString( PyModule_GetName( libpyroot_pymodule ) );
122 gExpand = PyCFunction_NewEx( &s_pdefExp, NULL, pymname );
123 Py_DECREF( pymname );
124 Bool_t isOk = PyObject_SetAttrString( libpyroot_pymodule, s_pdefExp.ml_name, gExpand ) == 0;
125 Py_DECREF( gExpand );
128 Py_DECREF( libpyroot_pymodule );
129 PyErr_SetString( PyExc_TypeError,
"could not add expand function to libPyROOT" );
133 static PyMethodDef s_pdefRed = { (
char*)
"__reduce__",
137 isOk = PyDict_SetItemString( pytype->tp_dict, s_pdefRed.ml_name,
descr) == 0;
140 Py_DECREF( libpyroot_pymodule );
141 PyErr_SetString( PyExc_TypeError,
"could not add __reduce__ function to CPPInstance" );
145 Py_DECREF( libpyroot_pymodule );
The documentation for this class was generated from the following files: