Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Types | Static Public Member Functions
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 4460 of file arc_wrap.cpp.


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 4461 of file arc_wrap.cpp.


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 4487 of file arc_wrap.cpp.

                                                          {
       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::PyObject_var first = PySequence_GetItem(obj,0);
           swig::PyObject_var 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;
      }
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 4463 of file arc_wrap.cpp.

      {
       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;
       }      
      }

Here is the call graph for this function:


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