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
15public:
16 PyObject* GetTypeName() override;
17
18public:
19 PyCallable* Clone() override { return new CPPFunction(*this); }
21 CPyCppyy_PyArgs_t args, size_t nargsf, PyObject* kwds, CallContext* ctxt = nullptr) override;
22
23protected:
24 bool ProcessArgs(PyCallArgs& args) override;
25};
26
27// Wrapper for global binary operators that swap arguments
29public:
30 using CPPFunction::CPPFunction;
31
32 PyCallable* Clone() override { return new CPPFunction(*this); }
34 CPyCppyy_PyArgs_t args, size_t nargsf, PyObject* kwds, CallContext* ctxt = nullptr) override;
35
36protected:
37 bool ProcessArgs(PyCallArgs& args) override;
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
PyCallable * Clone() override
Definition CPPFunction.h:19
PyObject * GetTypeName() override
PyObject * Call(CPPInstance *&self, CPyCppyy_PyArgs_t args, size_t nargsf, PyObject *kwds, CallContext *ctxt=nullptr) override
bool ProcessArgs(PyCallArgs &args) override
CPPMethod(Cppyy::TCppScope_t scope, Cppyy::TCppMethod_t method)
bool ProcessArgs(PyCallArgs &args) override
PyObject * Call(CPPInstance *&self, CPyCppyy_PyArgs_t args, size_t nargsf, PyObject *kwds, CallContext *ctxt=nullptr) override
PyCallable * Clone() override
Definition CPPFunction.h:32
bool AdjustSelf(PyCallArgs &cargs)