Logo ROOT  
Reference Guide
CPPClassMethod.cxx
Go to the documentation of this file.
1// Bindings
2#include "CPyCppyy.h"
3#include "CPPClassMethod.h"
4
5
6//- public members --------------------------------------------------------------
8 CPPInstance*&, PyObject* args, PyObject* kwds, CallContext* ctxt)
9{
10// preliminary check in case keywords are accidently used (they are ignored otherwise)
11 if (kwds && PyDict_Size(kwds)) {
12 PyErr_SetString(PyExc_TypeError, "keyword arguments are not yet supported");
13 return nullptr;
14 }
15
16// setup as necessary
17 if (!this->Initialize(ctxt))
18 return nullptr;
19
20// translate the arguments
21 if (!this->ConvertAndSetArgs(args, ctxt))
22 return nullptr;
23
24// execute function
25 return this->Execute(nullptr, 0, ctxt);
26}
_object PyObject
Definition: PyMethodBase.h:41
virtual PyObject * Call(CPPInstance *&, PyObject *args, PyObject *kwds, CallContext *ctxt=nullptr)
bool Initialize(CallContext *ctxt=nullptr)
Definition: CPPMethod.cxx:528
PyObject * Execute(void *self, ptrdiff_t offset, CallContext *ctxt=nullptr)
Definition: CPPMethod.cxx:712
bool ConvertAndSetArgs(PyObject *args, CallContext *ctxt=nullptr)
Definition: CPPMethod.cxx:673