Static Public Member Functions | |
static Type * | as (PyObject *obj, bool throw_error) |
Definition at line 3719 of file SyFi_wrap.cc.
static Type* swig::traits_as< Type *, pointer_category >::as | ( | PyObject * | obj, | |
bool | throw_error | |||
) | [inline, static] |
Definition at line 3720 of file SyFi_wrap.cc.
References swig::traits_asptr< Type >::asptr(), run_all::res, SWIG_Error, SWIG_ERROR, SWIG_IsOK, and SWIG_TypeError.
03720 { 03721 Type *v = 0; 03722 int res = (obj ? traits_asptr<Type>::asptr(obj, &v) : SWIG_ERROR); 03723 if (SWIG_IsOK(res)) { 03724 return v; 03725 } else { 03726 if (!PyErr_Occurred()) { 03727 SWIG_Error(SWIG_TypeError, swig::type_name<Type>()); 03728 } 03729 if (throw_error) throw std::invalid_argument("bad type"); 03730 return 0; 03731 } 03732 }