19#define CPYCPPYY_INTERNAL 1
26#undef CPYCPPYY_INTERNAL
38#if PY_VERSION_HEX < 0x030b0000
48#if PY_VERSION_HEX < 0x030b0000
51#if PY_VERSION_HEX >= 0x03030000
64#if PY_VERSION_HEX >= 0x03060000
79#define CPYCPPYY_GET_DICT_LOOKUP(mp) \
80 ((dict_lookup_func&)mp->ma_keys->dk_lookup)
84#define CPYCPPYY_GET_DICT_LOOKUP(mp) \
85 ((dict_lookup_func&)mp->ma_lookup)
109#if PY_VERSION_HEX < 0x03000000
160 0, 0, 0, 0, 0,
Py_TPFLAGS_DEFAULT, 0, 0, 0, 0, 0, 0, 0,
161 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
202 0, 0, 0, 0, 0,
Py_TPFLAGS_DEFAULT, 0, 0, 0, 0, 0, 0, 0,
203 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
253 static std::map<std::string, std::vector<PyObject*>>
pyzMap;
266#if PY_VERSION_HEX < 0x030b0000
285#if PY_VERSION_HEX >= 0x03060000
291#define CPYCPPYY_ORGDICT_LOOKUP(mp, key, hash, value_addr, hashpos) \
292 OrgDictLookup(mp, key, hash, value_addr, hashpos)
297#elif PY_VERSION_HEX >= 0x03030000
304#define CPYCPPYY_ORGDICT_LOOKUP(mp, key, hash, value_addr, hashpos) \
305 OrgDictLookup(mp, key, hash, value_addr)
317#define CPYCPPYY_ORGDICT_LOOKUP(mp, key, hash, value_addr, hashpos) \
318 OrgDictLookup(mp, key, hash)
323 static GblGetter
gbl;
324#if PY_VERSION_HEX >= 0x03060000
335#if PY_VERSION_HEX >= 0x03060000
338 if (!
ep || (
ep->me_key &&
ep->me_value))
370#if PY_VERSION_HEX >= 0x03060000
373 ep->me_key =
nullptr;
374 ep->me_value =
nullptr;
384#if PY_VERSION_HEX >= 0x03030000
385 if (
mp->ma_keys->dk_usable <= 0) {
401 if (0 <
mp->ma_keys->dk_usable)
424#if PY_VERSION_HEX < 0x030b0000
468static char*
GCIA_kwlist[] = {(
char*)
"instance", (
char*)
"field", (
char*)
"byref",
NULL};
508 if (
req ==
"Instance_AsVoidPtr")
510 else if (
req ==
"Instance_FromVoidPtr")
590#if PY_VERSION_HEX < 0x02060000
610 if (!
ctmod)
return nullptr;
640 PyExc_TypeError,
"object is not a proxy to an array of PODs of known size");
647 view.buf =
pyobj->GetObject();
655 view.suboffsets =
NULL;
656 view.internal =
NULL;
690 "bind_object expects a valid class or class name as an argument");
723 "provided instance and provided target type are unrelated");
776 void*
addr =
nullptr;
788 if (!
addr || !buflen) {
790 "bind_object requires a CObject/Capsule, long integer, buffer, or instance as first argument");
860 p1->second.erase(
p2);
896#define DEFINE_CALL_POLICY_TOGGLE(name, flagname) \
897static PyObject* name(PyObject*, PyObject* args) \
899 PyObject* enabled = 0; \
900 if (!PyArg_ParseTuple(args, const_cast<char*>("O"), &enabled)) \
903 if (CallContext::SetGlobalPolicy(CallContext::flagname, PyObject_IsTrue(enabled))) { \
986 METH_O, (
char*)
"Represent an array of objects as raw memory."},
990 METH_O, (
char*)
"Cast the C++ object to become movable."},
996 METH_O, (
char*)
"Install a type pinning."},
997 {(
char*)
"_add_type_reducer", (
PyCFunction)AddTypeReducer,
1000 METH_VARARGS, (
char*)
"Set the global memory policy, which affects object ownership when objects are passed as function arguments."},
1002 METH_VARARGS, (
char*)
"Enable or disable the implicit conversion to smart pointers in function calls (on by default)."},
1004 (
char *)
"Set the global signal policy, which determines whether a jmp address should be saved to return to after a "
1005 "C++ segfault. In practical terms: trap signals in safe mode to prevent interpreter abort."},
1006 {(
char*)
"SetOwnership", (
PyCFunction)SetOwnership,
1007 METH_VARARGS, (
char*)
"Modify held C++ object ownership."},
1008 {(
char*)
"AddSmartPtrType", (
PyCFunction)AddSmartPtrType,
1009 METH_VARARGS, (
char*)
"Add a smart pointer to the list of known smart pointer types."},
1011 METH_NOARGS, (
char*)
"Begin capturing stderr to a in memory buffer."},
1013 METH_NOARGS, (
char*)
"End capturing stderr and returns the captured buffer."},
1014 {
nullptr,
nullptr, 0,
nullptr}
1018#if PY_VERSION_HEX >= 0x03000000
1023#define GETSTATE(m) ((struct module_state*)PyModule_GetState(m))
1063#if PY_VERSION_HEX < 0x03090000
1067#if PY_VERSION_HEX < 0x030b0000
1074#if PY_VERSION_HEX >= 0x03030000
1083#if PY_VERSION_HEX >= 0x03000000
1126#if PY_VERSION_HEX < 0x03000000
1183#if PY_VERSION_HEX >= 0x03000000
static PyObject * default_repr(PyObject *)
#define CPYCPPYY_ORGDICT_LOOKUP(mp, key, hash, value_addr, hashpos)
#define DEFINE_CALL_POLICY_TOGGLE(name, flagname)
static PyObject * nullptr_repr(PyObject *)
static PyNumberMethods nullptr_as_number
static void default_dealloc(PyObject *)
static PyTypeObject PyDefault_t_Type
static void nullptr_dealloc(PyObject *)
static int nullptr_nonzero(PyObject *)
static PyMethodDef gCPyCppyyMethods[]
static PyTypeObject PyNullPtr_t_Type
#define CPYCPPYY_GET_DICT_LOOKUP(mp)
PyDictEntry *(* dict_lookup_func)(PyDictObject *, PyObject *, long)
#define PY_SSIZE_T_FORMAT
static void * CPyCppyy_PyCapsule_GetPointer(PyObject *capsule, const char *)
#define CPyCppyy_PyText_AsString
#define CPYCPPYY_PYTYPE_TAIL
static PyObject * CPyCppyy_PyCapsule_New(void *cobj, const char *, void(*destr)(void *))
static PyObject * PyObject_CallMethodOneArg(PyObject *obj, PyObject *name, PyObject *arg)
#define CPyCppyy_PyText_FromFormat
#define CPyCppyy_PyText_Type
#define CPyCppyy_PyText_FromString
#define CPyCppyy_PyText_Check
#define PyVarObject_HEAD_INIT(type, size)
static struct PyModuleDef moduledef
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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 Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
TTime operator*(const TTime &t1, const TTime &t2)
const_iterator begin() const
const_iterator end() const
Py_ssize_t GetBuffer(PyObject *pyobject, char tc, int size, void *&buf, bool check=true)
std::string ConstructTemplateArgs(PyObject *pyname, PyObject *tpArgs, PyObject *args=nullptr, ArgPreference=kNone, int argoff=0, int *pcnt=nullptr)
bool InitProxy(PyObject *module, PyTypeObject *pytype, const char *name)
PyTypeObject CPPInstance_Type
PyObject * gAbrtException
PyObject * gDefaultObject
PyTypeObject VectorIter_Type
PyTypeObject CPPExcInstance_Type
PyObject * GetScopeProxy(Cppyy::TCppScope_t)
std::ostringstream gCapturedError
dict_lookup_func gDictLookupOrg
PyTypeObject CustomInstanceMethod_Type
PyObject * CreateScopeProxy(Cppyy::TCppScope_t, const unsigned flags=0)
bool CPPDataMember_CheckExact(T *object)
PyTypeObject RefFloat_Type
Custom "builtins," detectable by type, for pass by ref and improved performance.
PyObject * gSegvException
std::set< Cppyy::TCppType_t > gPinnedTypes
PyObject * DestroyPyStrings()
PyObject * BindCppObjectNoCast(Cppyy::TCppObject_t object, Cppyy::TCppType_t klass, const unsigned flags=0)
std::map< std::string, std::vector< PyObject * > > & pythonizations()
bool CPPScope_Check(T *object)
CPYCPPYY_EXTERN PyObject * Instance_FromVoidPtr(void *addr, const std::string &classname, bool python_owns=false)
bool CPPInstance_Check(T *object)
PyTypeObject IndexIter_Type
PyObject * gNullPtrObject
PyTypeObject CPPOverload_Type
PyTypeObject TemplateProxy_Type
PyTypeObject InstanceArrayIter_Type
bool CPPDataMember_Check(T *object)
PyObject * BindCppObject(Cppyy::TCppObject_t object, Cppyy::TCppType_t klass, const unsigned flags=0)
CPYCPPYY_EXTERN void * Instance_AsVoidPtr(PyObject *pyobject)
PyTypeObject CPPScope_Type
PyTypeObject LowLevelView_Type
bool CPPOverload_CheckExact(T *object)
PyTypeObject CPPDataMember_Type
std::streambuf * gOldErrorBuffer
PyTypeObject TupleOfInstances_Type
Representation of C-style array of instances.
RPY_EXPORTED ptrdiff_t GetBaseOffset(TCppType_t derived, TCppType_t base, TCppObject_t address, int direction, bool rerror=false)
RPY_EXPORTED size_t SizeOf(TCppType_t klass)
RPY_EXPORTED void AddSmartPtrType(const std::string &)
RPY_EXPORTED bool IsSubtype(TCppType_t derived, TCppType_t base)
RPY_EXPORTED void AddTypeReducer(const std::string &reducable, const std::string &reduced)
RPY_EXPORTED bool IsAggregate(TCppType_t type)
RPY_EXPORTED TCppScope_t GetScope(const std::string &scope_name)
PyObject_HEAD char * b_ptr