Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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
15public:
16 virtual PyObject* GetTypeName();
17
18public:
19 virtual PyCallable* Clone() { return new CPPFunction(*this); }
20 virtual PyObject* Call(CPPInstance*& self,
21 CPyCppyy_PyArgs_t args, size_t nargsf, PyObject* kwds, CallContext* ctxt = nullptr);
22
23protected:
24 virtual bool ProcessArgs(PyCallArgs& args);
25};
26
27// Wrapper for global binary operators that swap arguments
29public:
30 using CPPFunction::CPPFunction;
31
32 virtual PyCallable* Clone() { return new CPPFunction(*this); }
33 virtual PyObject* Call(CPPInstance*& self,
34 CPyCppyy_PyArgs_t args, size_t nargsf, PyObject* kwds, CallContext* ctxt = nullptr);
35
36protected:
37 virtual bool ProcessArgs(PyCallArgs& args);
38};
39
40// Helper to add self to the arguments tuple if rebound
41bool AdjustSelf(PyCallArgs& cargs);
42
43} // namespace CPyCppyy
44
45#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:19
virtual PyObject * GetTypeName()
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:32
bool AdjustSelf(PyCallArgs &cargs)