PythonMonkey   v1.0.0 (dev)
Loading...
Searching...
No Matches
JSMethodProxy.hh
Go to the documentation of this file.
1
11#ifndef PythonMonkey_JSMethodProxy_
12#define PythonMonkey_JSMethodProxy_
13
15
16#include <jsapi.h>
17
18#include <Python.h>
23typedef struct {
24 PyObject_HEAD
25 PyObject *self;
26 JS::PersistentRootedObject *jsFunc;
28
34public:
40 static void JSMethodProxy_dealloc(JSMethodProxy *self);
41
50 static PyObject *JSMethodProxy_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
51
60 static PyObject *JSMethodProxy_call(PyObject *self, PyObject *args, PyObject *kwargs);
61};
62
66extern PyTypeObject JSMethodProxyType;
67
68#endif
JSFunctionProxy is a custom C-implemented python type. It acts as a proxy for JSFunctions from Spider...
PyTypeObject JSMethodProxyType
Struct for the JSMethodProxyType, used by all JSMethodProxy objects.
Definition pythonmonkey.cc:178
This struct is a bundle of methods used by the JSMethodProxy type.
Definition JSMethodProxy.hh:33
static void JSMethodProxy_dealloc(JSMethodProxy *self)
Deallocation method (.tp_dealloc), removes the reference to the underlying JSFunction before freeing ...
Definition JSMethodProxy.cc:22
static PyObject * JSMethodProxy_call(PyObject *self, PyObject *args, PyObject *kwargs)
Call method (.tp_call), called when the JSMethodProxy is called, properly handling self and this
Definition JSMethodProxy.cc:46
static PyObject * JSMethodProxy_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
New method (.tp_new), creates a new instance of the JSMethodProxy type, exposed as the new() method i...
Definition JSMethodProxy.cc:28
The typedef for the backing store that will be used by JSMethodProxy objects. All it contains is a po...
Definition JSMethodProxy.hh:23
PyObject_HEAD PyObject * self
Definition JSMethodProxy.hh:25
JS::PersistentRootedObject * jsFunc
Definition JSMethodProxy.hh:26