48 if (strcmp(clname,
"TBufferFile") == 0) {
77 PyDict_GetItemString(PyModule_GetDict(
PyROOT::gRootModule),
const_cast<char *
>(
"_CPPInstance__expand__"));
87 if (className.find(
"__cppyy_internal::Dispatcher") == 0) {
88 PyErr_Format(PyExc_IOError,
"generic streaming of Python objects whose class derives from a C++ class is not supported. "
89 "Please refer to the Python pickle documentation for instructions on how to define "
90 "a custom __reduce__ method for the derived Python class");
100 PyErr_Format(PyExc_IOError,
"could not stream object of type %s",
115 PyTuple_SET_ITEM(
result, 0, s_expand);
116 PyTuple_SET_ITEM(
result, 1, res2);
131 PyObject *pyclass = PyTuple_GetItem(args, 0);
133 const char *
attr =
"__reduce__";
135 PyMethodDef *pdef =
new PyMethodDef();
136 pdef->ml_name =
attr;
138 pdef->ml_flags = METH_NOARGS;
139 pdef->ml_doc =
nullptr;
141 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
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t attr
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.