Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
CPPFunction.h
Go to the documentation of this file.
1#ifndef CPYCPPYY_CPPFUNCTION_H
2#define CPYCPPYY_CPPFUNCTION_H
3
4// Bindings
5#include "CPPMethod.h"
6
7
8namespace CPyCppyy {
9
10// Wrapper for global free/static C++ functions
11class CPPFunction : public CPPMethod {
12public:
14
15 virtual PyCallable* Clone() { return new CPPFunction(*this); }
16 virtual PyObject* Call(CPPInstance*& self,
17 CPyCppyy_PyArgs_t args, size_t nargsf, PyObject* kwds, CallContext* ctxt = nullptr);
18
19protected:
20 virtual bool ProcessArgs(PyCallArgs& args);
21};
22
23// Wrapper for global binary operators that swap arguments
25public:
26 using CPPFunction::CPPFunction;
27
28 virtual PyCallable* Clone() { return new CPPFunction(*this); }
29 virtual PyObject* Call(CPPInstance*& self,
30 CPyCppyy_PyArgs_t args, size_t nargsf, PyObject* kwds, CallContext* ctxt = nullptr);
31
32protected:
33 virtual bool ProcessArgs(PyCallArgs& args);
34};
35
36// Helper to add self to the arguments tuple if rebound
37bool AdjustSelf(PyCallArgs& cargs);
38
39} // namespace CPyCppyy
40
41#endif // !CPYCPPYY_CPPFUNCTION_H
PyObject * CPyCppyy_PyArgs_t
Definition CPyCppyy.h:330
_object PyObject
virtual PyObject * Call(CPPInstance *&self, CPyCppyy_PyArgs_t args, size_t nargsf, PyObject *kwds, CallContext *ctxt=nullptr)
virtual bool ProcessArgs(PyCallArgs &args)
virtual PyCallable * Clone()
Definition CPPFunction.h:15
CPPMethod(Cppyy::TCppScope_t scope, Cppyy::TCppMethod_t method)
virtual bool ProcessArgs(PyCallArgs &args)
virtual PyObject * Call(CPPInstance *&self, CPyCppyy_PyArgs_t args, size_t nargsf, PyObject *kwds, CallContext *ctxt=nullptr)
virtual PyCallable * Clone()
Definition CPPFunction.h:28
bool AdjustSelf(PyCallArgs &cargs)