PLearn 0.1
Static Public Member Functions
PLearn::ConvertToPyObject< T * > Struct Template Reference

#include <PythonObjectWrapper.h>

List of all members.

Static Public Member Functions

static PyObject * newPyObject (const T *x)

Detailed Description

template<typename T>
struct PLearn::ConvertToPyObject< T * >

Definition at line 962 of file PythonObjectWrapper.h.


Member Function Documentation

template<typename T >
static PyObject* PLearn::ConvertToPyObject< T * >::newPyObject ( const T *  x) [inline, static]

Definition at line 964 of file PythonObjectWrapper.h.

References PLearn::PythonObjectWrapper::newPyObject(), PLearn::ConvertToPyObject< T >::newPyObject(), and PLERROR.

    {
        if(!x) // null ptr. becomes None
            return PythonObjectWrapper::newPyObject();

        if (const Object* objx = dynamic_cast<const Object*>(x))
            return ConvertToPyObject<Object*>::newPyObject(objx);

        PLERROR("Cannot convert type %s by value to python",
                TypeTraits<T*>::name().c_str());
        return 0;//shut up compiler
    }

Here is the call graph for this function:


The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines