35 clName.c_str(), clName.c_str(), this->GetMethod() ? this->GetSignatureString().c_str() :
"()");
60 if (fArgsRequired == -1 && !this->Initialize(ctxt))
65 if (!this->ProcessArgs(cargs))
70 PyErr_SetString(PyExc_ReferenceError,
"no python object allocated");
75 PyErr_SetString(PyExc_ReferenceError,
76 "object already constructed; use __assign__ instead of __init__");
87 if (GetScope() != disp) {
94 if (!GetScope() || !disp) {
95 PyErr_SetString(PyExc_TypeError,
"can not construct incomplete C++ class");
102 PyErr_SetString(PyExc_TypeError,
"dispatcher proxy was never created");
107 PyErr_SetString(PyExc_TypeError,
const_cast<char*
>((
117 address = (intptr_t)((
CPPInstance*)pyobj)->GetObject();
120 PyObject* res = PyObject_CallMethodObjArgs(
124 Py_DECREF(dispproxy);
130 if (!this->ConvertAndSetArgs(cargs.fArgs, cargs.fNArgsf, ctxt))
133 address = (intptr_t)this->Execute(
nullptr, 0, ctxt);
142 self->
Set((
void*)address);
166 if (!PyErr_Occurred())
167 PyErr_SetString(PyExc_TypeError,
const_cast<char*
>(
216#if PY_VERSION_HEX >= 0x03080000
220 if (!this->ProcessArgs(cargs))
226 PyObject* args = PyTuple_New(nargs);
228 Py_INCREF(cargs.fArgs[i]);
229 PyTuple_SET_ITEM(args, i, cargs.fArgs[i]);
240 if (PyTuple_CheckExact(args) && PyTuple_GET_SIZE(args)) {
243 bool isAllTuples =
true;
246 PyObject* argi = PyTuple_GET_ITEM(args, i);
247 if (!PyTuple_CheckExact(argi)) {
251 nArgsTot += PyTuple_GET_SIZE(argi);
257 PyObject* newArgs = PyTuple_New(nArgsTot + fNumBases - 1);
267 PyObject* argi = PyTuple_GET_ITEM(args, i);
268 for (
Py_ssize_t j = 0; j < PyTuple_GET_SIZE(argi); ++j) {
269 PyObject* item = PyTuple_GET_ITEM(argi, j);
271 PyTuple_SET_ITEM(newArgs, idx, item);
277 while (idx < (nArgsTot+fNumBases-1)) {
287 PyObject* newArgs = PyTuple_New(PyTuple_GET_SIZE(args) + fNumBases - 1);
289 PyObject* item = PyTuple_GET_ITEM(args, i);
291 PyTuple_SET_ITEM(newArgs, i, item);
293 for (
Py_ssize_t i = 0; i < fNumBases - 1; ++i) {
302#if PY_VERSION_HEX < 0x03080000
305 nargs = PyTuple_GET_SIZE(args);
307#if PY_VERSION_HEX >= 0x03080000
309 auto argsu = std::unique_ptr<PyObject*[]>{
new PyObject*[nargs]};
311 argsu[i] = PyTuple_GET_ITEM(args, i);
329 if ((self && GetScope() != self->
ObjectIsA()
330#
if PY_VERSION_HEX >= 0x03080000
340 PyErr_Format(PyExc_TypeError,
"cannot instantiate abstract class \'%s\'"
341 " (from derived classes, use super() instead)",
352 PyErr_Format(PyExc_TypeError,
"cannot instantiate namespace \'%s\'",
363 PyErr_Format(PyExc_TypeError,
"cannot instantiate incomplete class \'%s\'",
373 PyErr_Format(PyExc_TypeError,
"cannot instantiate class \'%s\' that has no public constructors",
static Py_ssize_t CPyCppyy_PyArgs_GET_SIZE(CPyCppyy_PyArgs_t args, size_t)
PyObject * CPyCppyy_PyArgs_t
#define Py_SET_TYPE(ob, type)
PyObject * CPyCppyy_PyObject_Call(PyObject *cb, PyObject *args, size_t, PyObject *kwds)
#define CPyCppyy_PyText_FromFormat
#define CPyCppyy_PyText_FromString
Cppyy::TCppType_t fUnderlyingType
std::ios_base::fmtflags fFlags
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 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 Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t format
virtual PyObject * Call(CPPInstance *&self, CPyCppyy_PyArgs_t args, size_t nargsf, PyObject *kwds, CallContext *ctxt=nullptr)
virtual PyObject * Call(CPPInstance *&self, CPyCppyy_PyArgs_t args, size_t nargsf, PyObject *kwds, CallContext *ctxt=nullptr)
virtual PyObject * GetDocString()
virtual bool InitExecutor_(Executor *&, CallContext *ctxt=nullptr)
virtual PyObject * Reflex(Cppyy::Reflex::RequestId_t, Cppyy::Reflex::FormatId_t=Cppyy::Reflex::OPTIMAL)
virtual PyObject * Call(CPPInstance *&self, CPyCppyy_PyArgs_t args, size_t nargsf, PyObject *kwds, CallContext *ctxt=nullptr)
virtual PyObject * Call(CPPInstance *&self, CPyCppyy_PyArgs_t args, size_t nargsf, PyObject *kwds, CallContext *ctxt=nullptr)
void Set(void *address, EFlags flags=kDefault)
void SetSmart(PyObject *smart_type)
Cppyy::TCppType_t ObjectIsA(bool check_smart=true) const
CPPMethod & operator=(const CPPMethod &)
CPPMultiConstructor(Cppyy::TCppScope_t scope, Cppyy::TCppMethod_t method)
CPPMultiConstructor & operator=(const CPPMultiConstructor &)
virtual PyObject * Call(CPPInstance *&self, CPyCppyy_PyArgs_t args, size_t nargsf, PyObject *kwds, CallContext *ctxt=nullptr)
virtual PyObject * Call(CPPInstance *&self, CPyCppyy_PyArgs_t args, size_t nargsf, PyObject *kwds, CallContext *ctxt=nullptr)
static bool RegisterPyObject(CPPInstance *pyobj, void *cppobj)
virtual PyObject * Reflex(Cppyy::Reflex::RequestId_t request, Cppyy::Reflex::FormatId_t format=Cppyy::Reflex::OPTIMAL)
PyObject * GetScopeProxy(Cppyy::TCppScope_t)
PyObject * CreateScopeProxy(Cppyy::TCppScope_t, const unsigned flags=0)
CPYCPPYY_EXTERN Executor * CreateExecutor(const std::string &name, cdims_t=0)
bool CPPInstance_Check(T *object)
PyObject * gNullPtrObject
const RequestId_t RETURN_TYPE
const FormatId_t AS_STRING
RPY_EXPORTED std::string GetScopedFinalName(TCppType_t type)
RPY_EXPORTED TCppIndex_t GetNumBases(TCppType_t type)
RPY_EXPORTED std::string GetFinalName(TCppType_t type)