Alexandria 2.31.0
SDC-CH common library for the Euclid project
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
Pyston::NodeConverter< T > Struct Template Reference

#include <NodeConverter.h>

Static Public Member Functions

static void * isConvertible (PyObject *obj_ptr)
 
static bool fromPrimitive (PyObject *obj_ptr, void *storage)
 
static void construct (PyObject *obj_ptr, boost::python::converter::rvalue_from_python_stage1_data *data)
 

Detailed Description

template<typename T>
struct Pyston::NodeConverter< T >

Implements the conversion logic from python primitives into Node

Template Parameters
TNode type into which types can be converted

Definition at line 159 of file NodeConverter.h.

Member Function Documentation

◆ construct()

template<typename T >
static void Pyston::NodeConverter< T >::construct ( PyObject *  obj_ptr,
boost::python::converter::rvalue_from_python_stage1_data *  data 
)
inlinestatic

Construct a new Node type from the given python object

Parameters
obj_ptrPython object
databoost python data required to construct the new object

Definition at line 231 of file NodeConverter.h.

References Pyston::NodeCast< T >::cast(), and Pyston::NodeConverter< T >::fromPrimitive().

Here is the call graph for this function:

◆ fromPrimitive()

template<typename T >
static bool Pyston::NodeConverter< T >::fromPrimitive ( PyObject *  obj_ptr,
void *  storage 
)
inlinestatic

Create a new Constant Node from a python primitive type: python floats, longs or booleans

Parameters
obj_ptrPython object
storageMemory area, handled by boost::python, where to store the new object
Returns
true if it could be converted

Definition at line 203 of file NodeConverter.h.

Referenced by Pyston::NodeConverter< T >::construct().

◆ isConvertible()

template<typename T >
static void * Pyston::NodeConverter< T >::isConvertible ( PyObject *  obj_ptr)
inlinestatic

Check if the python object can be converted to a known type

Parameters
obj_ptrPython object
Returns
obj_ptr if it can be converted, NULL otherwise

Definition at line 167 of file NodeConverter.h.


The documentation for this struct was generated from the following file: