Static Public Member Functions | |
static Type | as (PyObject *obj, bool throw_error) |
Definition at line 3678 of file SyFi_wrap.cc.
static Type swig::traits_as< Type, value_category >::as | ( | PyObject * | obj, | |
bool | throw_error | |||
) | [inline, static] |
Definition at line 3679 of file SyFi_wrap.cc.
References swig::asval(), run_all::res, SWIG_Error, SWIG_IsOK, and SWIG_TypeError.
03679 { 03680 Type v; 03681 int res = asval(obj, &v); 03682 if (!obj || !SWIG_IsOK(res)) { 03683 if (!PyErr_Occurred()) { 03684 ::SWIG_Error(SWIG_TypeError, swig::type_name<Type>()); 03685 } 03686 if (throw_error) throw std::invalid_argument("bad type"); 03687 } 03688 return v; 03689 }