SyFi
0.3
|
Public Types | |
typedef std::pair< T, U > | value_type |
Static Public Member Functions | |
static int | get_pair (PyObject *first, PyObject *second, std::pair< T, U > **val) |
static int | asptr (PyObject *obj, std::pair< T, U > **val) |
Definition at line 4938 of file SyFiPYTHON_wrap.cxx.
typedef std::pair<T,U> swig::traits_asptr< std::pair< T, U > >::value_type |
Definition at line 4939 of file SyFiPYTHON_wrap.cxx.
static int swig::traits_asptr< std::pair< T, U > >::asptr | ( | PyObject * | obj, |
std::pair< T, U > ** | val | ||
) | [inline, static] |
Definition at line 4965 of file SyFiPYTHON_wrap.cxx.
References SyFi::p, PySequence_Size, run_all::res, SWIG_ConvertPtr, SWIG_ERROR, and SWIG_IsOK.
{ int res = SWIG_ERROR; if (PyTuple_Check(obj)) { if (PyTuple_GET_SIZE(obj) == 2) { res = get_pair(PyTuple_GET_ITEM(obj,0),PyTuple_GET_ITEM(obj,1), val); } } else if (PySequence_Check(obj)) { if (PySequence_Size(obj) == 2) { swig::SwigVar_PyObject first = PySequence_GetItem(obj,0); swig::SwigVar_PyObject second = PySequence_GetItem(obj,1); res = get_pair(first, second, val); } } else { value_type *p; res = SWIG_ConvertPtr(obj,(void**)&p,swig::type_info<value_type>(),0); if (SWIG_IsOK(res) && val) *val = p; } return res; }
static int swig::traits_asptr< std::pair< T, U > >::get_pair | ( | PyObject * | first, |
PyObject * | second, | ||
std::pair< T, U > ** | val | ||
) | [inline, static] |
Definition at line 4941 of file SyFiPYTHON_wrap.cxx.
References swig::asval(), SWIG_AddNewMask, and SWIG_IsOK.
{ if (val) { value_type *vp = (new std::pair<T,U>); T *pfirst = &(vp->first); int res1 = swig::asval((PyObject*)first, pfirst); if (!SWIG_IsOK(res1)) return res1; U *psecond = &(vp->second); int res2 = swig::asval((PyObject*)second, psecond); if (!SWIG_IsOK(res2)) return res2; *val = vp; return SWIG_AddNewMask(res1 > res2 ? res1 : res2); } else { T *pfirst = 0; int res1 = swig::asval((PyObject*)first, pfirst); if (!SWIG_IsOK(res1)) return res1; U *psecond = 0; int res2 = swig::asval((PyObject*)second, psecond); if (!SWIG_IsOK(res2)) return res2; return res1 > res2 ? res1 : res2; } }