SyFi  0.3
swig::traits_as< Type, pointer_category > Struct Template Reference

List of all members.

Static Public Member Functions

static Type as (PyObject *obj, bool throw_error)

Detailed Description

template<class Type>
struct swig::traits_as< Type, pointer_category >

Definition at line 3977 of file SyFiPYTHON_wrap.cxx.


Member Function Documentation

template<class Type >
static Type swig::traits_as< Type, pointer_category >::as ( PyObject *  obj,
bool  throw_error 
) [inline, static]

Definition at line 3978 of file SyFiPYTHON_wrap.cxx.

References swig::asptr(), run_all::res, SWIG_ERROR, SWIG_Error, SWIG_IsNewObj, SWIG_IsOK, SWIG_TypeError, and demo::v.

                                                    {
      Type *v = 0;      
      int res = (obj ? traits_asptr<Type>::asptr(obj, &v) : SWIG_ERROR);
      if (SWIG_IsOK(res) && v) {
        if (SWIG_IsNewObj(res)) {
          Type r(*v);
          delete v;
          return r;
        } else {
          return *v;
        }
      } else {
        // Uninitialized return value, no Type() constructor required.
        static Type *v_def = (Type*) malloc(sizeof(Type));
        if (!PyErr_Occurred()) {
          SWIG_Error(SWIG_TypeError,  swig::type_name<Type>());
        }
        if (throw_error) throw std::invalid_argument("bad type");
        memset(v_def,0,sizeof(Type));
        return *v_def;
      }
    }

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