H3D API  2.4.1
Static Public Member Functions | List of all members
H3D::PyTypeWrapper< Type, TypeObject, NameFunc, CheckFunc, ValueFunc, NewFunc > Struct Template Reference

PyTypeWrapper is a template wrapper class to create new Python types from types already existing in the H3DAPI (see PythonTypes.h) for example usage. More...

#include <H3D/PyTypeWrapper.h>

Inheritance diagram for H3D::PyTypeWrapper< Type, TypeObject, NameFunc, CheckFunc, ValueFunc, NewFunc >:
Inheritance graph

Static Public Member Functions

static void installType (PyObject *_H3D_module)
 Install type in the given python module. More...
 
static PyObject * create ()
 create() a new instance of Type using Python to allocate the memory and initialise the PyObject headers - to be called by PythonScript's internals.
 
static void dealloc (PyObject *self)
 Python type deallocation.
 
static PyObject * repr (PyObject *myself, PyObject *)
 Converts to a char* string.
 
static int compare (PyObject *veca, PyObject *vecb)
 Test if two PyTypes are equal or not.
 

Detailed Description

template<class Type, PyTypeObject * TypeObject, string(*)() NameFunc, bool(*)(PyObject *) CheckFunc, Type(*)(PyObject *) ValueFunc, PyObject *(*)(const Type &) NewFunc>
struct H3D::PyTypeWrapper< Type, TypeObject, NameFunc, CheckFunc, ValueFunc, NewFunc >

PyTypeWrapper is a template wrapper class to create new Python types from types already existing in the H3DAPI (see PythonTypes.h) for example usage.

Parameters
TypeThe H3DAPI type to make a Python type of.
TypeObjectA PyTypeObject for that type.
CheckFuncA function for checking that a PyObject * is of the new Python type.
ValueFuncA function for extracting the value of the type that has been wrapped in the python type.
NewFuncA function for creating a new instance of the Python class given an instance of Type.

Member Function Documentation

◆ installType()

template<class Type , PyTypeObject * TypeObject, string(*)() NameFunc, bool(*)(PyObject *) CheckFunc, Type(*)(PyObject *) ValueFunc, PyObject *(*)(const Type &) NewFunc>
static void H3D::PyTypeWrapper< Type, TypeObject, NameFunc, CheckFunc, ValueFunc, NewFunc >::installType ( PyObject *  _H3D_module)
inlinestatic

Install type in the given python module.

Must be called if the type is to be used in a module.


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