|
SyFi
0.3
|
Static Public Member Functions | |
| static Type * | as (PyObject *obj, bool throw_error) |
Definition at line 4023 of file SyFiPYTHON_wrap.cxx.
| static Type* swig::traits_as< Type *, pointer_category >::as | ( | PyObject * | obj, |
| bool | throw_error | ||
| ) | [inline, static] |
Definition at line 4024 of file SyFiPYTHON_wrap.cxx.
References swig::asptr(), SWIG_ERROR, SWIG_Error, SWIG_IsOK, SWIG_TypeError, and test_syfi::debug::v.
{
Type *v = 0;
int res = (obj ? traits_asptr<Type>::asptr(obj, &v) : SWIG_ERROR);
if (SWIG_IsOK(res)) {
return v;
} else {
if (!PyErr_Occurred()) {
SWIG_Error(SWIG_TypeError, swig::type_name<Type>());
}
if (throw_error) throw std::invalid_argument("bad type");
return 0;
}
}