30 clName.c_str(), clName.c_str(), this->GetMethod() ? this->GetSignatureString().c_str() :
"()");
38 if (fArgsRequired == -1 && !this->Initialize(ctxt))
42 if (!(args = this->PreProcessArgs(self, args, kwds)))
48 PyErr_SetString(PyExc_ReferenceError,
"no python object allocated");
54 PyErr_SetString(PyExc_ReferenceError,
55 "object already constructed; use __assign__ instead of __init__");
61 ptrdiff_t address = 0;
62 if (GetScope() != disp) {
67 if (!GetScope() || !disp) {
68 PyErr_SetString(PyExc_TypeError,
"can not construct incomplete C++ class");
75 PyErr_SetString(PyExc_TypeError,
"dispatcher proxy was never created");
79 PyObject* pyobj = PyObject_Call(dispproxy, args, kwds);
84 address = (ptrdiff_t)((
CPPInstance*)pyobj)->GetObject();
87 PyObject* res = PyObject_CallMethodObjArgs(
96 if (!this->ConvertAndSetArgs(args, ctxt)) {
101 address = (ptrdiff_t)this->Execute(
nullptr, 0, ctxt);
113 self->
Set((
void*)address);
135 if (!PyErr_Occurred())
136 PyErr_SetString(PyExc_TypeError,
const_cast<char*
>(
150 if (self && GetScope() != self->
ObjectIsA()) {
155 PyErr_Format(PyExc_TypeError,
"cannot instantiate abstract class \'%s\'"
156 " (from derived classes, use super() instead)",
166 PyErr_Format(PyExc_TypeError,
"cannot instantiate namespace \'%s\'",
176 PyErr_Format(PyExc_TypeError,
"cannot instantiate incomplete class \'%s\'",
#define Py_SET_TYPE(ob, type)
#define CPyCppyy_PyText_FromFormat
Cppyy::TCppType_t fUnderlyingType
virtual PyObject * Call(CPPInstance *&, PyObject *, PyObject *, CallContext *=nullptr)
virtual PyObject * GetDocString()
virtual bool InitExecutor_(Executor *&, CallContext *ctxt=nullptr)
virtual PyObject * Call(CPPInstance *&self, PyObject *args, PyObject *kwds, CallContext *ctxt=nullptr)
virtual PyObject * Call(CPPInstance *&, PyObject *, PyObject *, CallContext *=nullptr)
void Set(void *address, EFlags flags=kDefault)
void SetSmart(PyObject *smart_type)
Cppyy::TCppType_t ObjectIsA(bool check_smart=true) const
virtual PyObject * Call(CPPInstance *&, PyObject *, PyObject *, CallContext *=nullptr)
static bool RegisterPyObject(CPPInstance *pyobj, void *cppobj)
PyObject * GetScopeProxy(Cppyy::TCppScope_t)
CPYCPPYY_EXTERN Executor * CreateExecutor(const std::string &name)
PyObject * CreateScopeProxy(Cppyy::TCppScope_t)
RPY_EXPORTED std::string GetFinalName(TCppType_t type)
RPY_EXPORTED std::string GetScopedFinalName(TCppType_t type)