48 if (strcmp(clname,
"TBufferFile") == 0) {
77 PyDict_GetItemString(PyModule_GetDict(
PyROOT::gRootModule),
const_cast<char *
>(
"_CPPInstance__expand__"));
93 PyErr_Format(PyExc_IOError,
"could not stream object of type %s",
108 PyTuple_SET_ITEM(result, 0, s_expand);
109 PyTuple_SET_ITEM(result, 1, res2);
124 PyObject *pyclass = PyTuple_GetItem(args, 0);
126 const char *attr =
"__reduce__";
128 PyMethodDef *pdef =
new PyMethodDef();
129 pdef->ml_name = attr;
131 pdef->ml_flags = METH_NOARGS;
132 pdef->ml_doc =
nullptr;
134 PyObject *func = PyCFunction_New(pdef,
nullptr);
PyObject * op_reduce(CPPInstance *self, PyObject *)
PyROOT object proxy pickle support Turn the object proxy instance into a character stream and return ...
#define PyBytes_AS_STRING
#define PyBytes_FromString
#define PyBytes_FromStringAndSize
#define CPyCppyy_PyText_FromString
Cppyy::TCppType_t ObjectIsA(bool check_smart=true) const
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket.
void * ReadObjectAny(const TClass *cast) override
Read object from I/O buffer.
void WriteFastArray(const Bool_t *b, Int_t n) override
Write array of n bools into the I/O buffer.
void Reset() override
Reset buffer object. Resets map and buffer offset.
Int_t WriteObjectAny(const void *obj, const TClass *ptrClass, Bool_t cacheReuse=kTRUE) override
Write object to I/O buffer.
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
Set of helper functions that are invoked from the pythonizors, on the Python side.
PyObject * CustomInstanceMethod_New(PyObject *func, PyObject *self, PyObject *pyclass)
PyObject * BindCppObject(Cppyy::TCppObject_t object, Cppyy::TCppType_t klass, const unsigned flags=0)
RPY_EXPORTED std::string GetScopedFinalName(TCppType_t type)
RPY_EXPORTED TCppScope_t GetScope(const std::string &scope_name)
PyObject * AddCPPInstancePickling(PyObject *self, PyObject *args)
Set reduce attribute for CPPInstance objects.
PyObject * CPPInstanceExpand(PyObject *self, PyObject *args)
Deserialize pickled objects.