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

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

#include "include/pyTypeFactory.hh"
#include "include/BoolType.hh"
#include "include/BufferType.hh"
#include "include/DateType.hh"
#include "include/DictType.hh"
#include "include/ExceptionType.hh"
#include "include/FloatType.hh"
#include "include/FuncType.hh"
#include "include/IntType.hh"
#include "include/jsTypeFactory.hh"
#include "include/ListType.hh"
#include "include/NoneType.hh"
#include "include/NullType.hh"
#include "include/PromiseType.hh"
#include "include/PyDictProxyHandler.hh"
#include "include/PyListProxyHandler.hh"
#include "include/PyObjectProxyHandler.hh"
#include "include/PyIterableProxyHandler.hh"
#include "include/PyBytesProxyHandler.hh"
#include "include/setSpiderMonkeyException.hh"
#include "include/StrType.hh"
#include "include/modules/pythonmonkey/pythonmonkey.hh"
#include <jsapi.h>
#include <jsfriendapi.h>
#include <js/Object.h>
#include <js/ValueArray.h>
Include dependency graph for pyTypeFactory.cc:

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) and Philippe Laporte (phili.nosp@m.ppe@.nosp@m.distr.nosp@m.ibut.nosp@m.ive.n.nosp@m.etwo.nosp@m.rk)
Date
2023-03-29

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