swig::traits_asptr< std::pair< T, U > > Struct Template Reference

List of all members.

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)


Detailed Description

template<class T, class U>
struct swig::traits_asptr< std::pair< T, U > >

Definition at line 4644 of file SyFi_wrap.cc.


Member Typedef Documentation

template<class T , class U >
typedef std::pair<T,U> swig::traits_asptr< std::pair< T, U > >::value_type

Definition at line 4645 of file SyFi_wrap.cc.


Member Function Documentation

template<class T , class U >
static int swig::traits_asptr< std::pair< T, U > >::asptr ( PyObject *  obj,
std::pair< T, U > **  val 
) [inline, static]

Definition at line 4671 of file SyFi_wrap.cc.

References SyFi::p, PySequence_Size, run_all::res, SWIG_ConvertPtr, SWIG_ERROR, and SWIG_IsOK.

04671                                                           {
04672         int res = SWIG_ERROR;
04673         if (PyTuple_Check(obj)) {
04674           if (PyTuple_GET_SIZE(obj) == 2) {
04675             res = get_pair(PyTuple_GET_ITEM(obj,0),PyTuple_GET_ITEM(obj,1), val);
04676           }
04677         } else if (PySequence_Check(obj)) {
04678           if (PySequence_Size(obj) == 2) {
04679             swig::SwigVar_PyObject first = PySequence_GetItem(obj,0);
04680             swig::SwigVar_PyObject second = PySequence_GetItem(obj,1);
04681             res = get_pair(first, second, val);
04682           }
04683         } else {
04684           value_type *p;
04685           res = SWIG_ConvertPtr(obj,(void**)&p,swig::type_info<value_type>(),0);
04686           if (SWIG_IsOK(res) && val)  *val = p;
04687         }
04688         return res;
04689       }

template<class T , class U >
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 4647 of file SyFi_wrap.cc.

References swig::asval(), SWIG_AddNewMask, and SWIG_IsOK.

04649       {
04650         if (val) {
04651           value_type *vp = (new std::pair<T,U>);
04652           T *pfirst = &(vp->first);
04653           int res1 = swig::asval((PyObject*)first, pfirst);
04654           if (!SWIG_IsOK(res1)) return res1;
04655           U *psecond = &(vp->second);
04656           int res2 = swig::asval((PyObject*)second, psecond);
04657           if (!SWIG_IsOK(res2)) return res2;
04658           *val = vp;
04659           return SWIG_AddNewMask(res1 > res2 ? res1 : res2);
04660         } else {
04661           T *pfirst = 0;
04662           int res1 = swig::asval((PyObject*)first, pfirst);
04663           if (!SWIG_IsOK(res1)) return res1;
04664           U *psecond = 0;
04665           int res2 = swig::asval((PyObject*)second, psecond);
04666           if (!SWIG_IsOK(res2)) return res2;
04667           return res1 > res2 ? res1 : res2;
04668         }       
04669       }


The documentation for this struct was generated from the following file:

Generated on Mon Aug 31 16:17:06 2009 for SyFi by  doxygen 1.5.9