Logo ROOT  
Reference Guide
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
17 virtual PyObject* Call(
18 CPPInstance*&, PyObject* args, PyObject* kwds, CallContext* ctx = nullptr);
19
20protected:
21 virtual PyObject* PreProcessArgs(CPPInstance*& self, PyObject* args, PyObject* kwds);
22};
23
24// Wrapper for global binary operators that swap arguments
26public:
27 using CPPFunction::CPPFunction;
28
29 virtual PyCallable* Clone() { return new CPPFunction(*this); }
30
31 virtual PyObject* Call(
32 CPPInstance*&, PyObject* args, PyObject* kwds, CallContext* ctx = nullptr);
33
34protected:
35 virtual PyObject* PreProcessArgs(CPPInstance*& self, PyObject* args, PyObject* kwds);
36};
37
38} // namespace CPyCppyy
39
40#endif // !CPYCPPYY_CPPFUNCTION_H
_object PyObject
Definition: PyMethodBase.h:42
virtual PyCallable * Clone()
Definition: CPPFunction.h:15
virtual PyObject * Call(CPPInstance *&, PyObject *args, PyObject *kwds, CallContext *ctx=nullptr)
Definition: CPPFunction.cxx:29
virtual PyObject * PreProcessArgs(CPPInstance *&self, PyObject *args, PyObject *kwds)
Definition: CPPFunction.cxx:8
CPPMethod(Cppyy::TCppScope_t scope, Cppyy::TCppMethod_t method)
Definition: CPPMethod.cxx:295
virtual PyObject * Call(CPPInstance *&, PyObject *args, PyObject *kwds, CallContext *ctx=nullptr)
Definition: CPPFunction.cxx:75
virtual PyObject * PreProcessArgs(CPPInstance *&self, PyObject *args, PyObject *kwds)
Definition: CPPFunction.cxx:57
virtual PyCallable * Clone()
Definition: CPPFunction.h:29
Set of helper functions that are invoked from the pythonizors, on the Python side.