PythonMonkey   v1.0.0 (dev)
Loading...
Searching...
No Matches
pyTypeFactory.hh File Reference

Function for wrapping arbitrary PyObjects into the appropriate PyType class, and coercing JS types to python types. More...

#include <jsapi.h>
#include <Python.h>
Include dependency graph for pyTypeFactory.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

PyObject * pyTypeFactory (JSContext *cx, JS::HandleValue rval)
 Function that takes a JS::Value and returns a corresponding PyObject* object, doing shared memory management when necessary.
 

Detailed Description

Function for wrapping arbitrary PyObjects into the appropriate PyType class, and coercing JS types to python types.

Author
Caleb Aikens (caleb.nosp@m.@dis.nosp@m.tribu.nosp@m.tive.nosp@m..netw.nosp@m.ork), Giovanni Tedesco (giova.nosp@m.nni@.nosp@m.distr.nosp@m.ibut.nosp@m.ive.n.nosp@m.etwo.nosp@m.rk) and Philippe Laporte (phili.nosp@m.ppe@.nosp@m.distr.nosp@m.ibut.nosp@m.ive.n.nosp@m.etwo.nosp@m.rk)
Date
2022-08-08

Function Documentation

◆ pyTypeFactory()

PyObject * pyTypeFactory ( JSContext *  cx,
JS::HandleValue  rval 
)

Function that takes a JS::Value and returns a corresponding PyObject* object, doing shared memory management when necessary.

Parameters
cx- Pointer to the javascript context of the JS::Value
rval- The JS::Value who's type and value we wish to encapsulate
Returns
PyObject* - Pointer to the object corresponding to the JS::Value