swig::traits_from< std::map< K, T > > Struct Template Reference

List of all members.

Public Types

typedef std::map< K, T > map_type
typedef map_type::const_iterator const_iterator
typedef map_type::size_type size_type

Static Public Member Functions

static PyObject * from (const map_type &map)


Detailed Description

template<class K, class T>
struct swig::traits_from< std::map< K, T > >

Definition at line 4748 of file SyFi_wrap.cc.


Member Typedef Documentation

template<class K , class T >
typedef map_type::const_iterator swig::traits_from< std::map< K, T > >::const_iterator

Definition at line 4750 of file SyFi_wrap.cc.

template<class K , class T >
typedef std::map<K,T> swig::traits_from< std::map< K, T > >::map_type

Definition at line 4749 of file SyFi_wrap.cc.

template<class K , class T >
typedef map_type::size_type swig::traits_from< std::map< K, T > >::size_type

Definition at line 4751 of file SyFi_wrap.cc.


Member Function Documentation

template<class K , class T >
static PyObject* swig::traits_from< std::map< K, T > >::from ( const map_type map  )  [inline, static]

Definition at line 4753 of file SyFi_wrap.cc.

References swig_type_info::clientdata, swig::traits_from< Type >::from(), SWIG_NewPointerObj, SWIG_POINTER_OWN, SWIG_PYTHON_THREAD_BEGIN_BLOCK, and SWIG_PYTHON_THREAD_END_BLOCK.

04753                                                  {
04754         swig_type_info *desc = swig::type_info<map_type>();
04755         if (desc && desc->clientdata) {
04756           return SWIG_NewPointerObj(new map_type(map), desc, SWIG_POINTER_OWN);
04757         } else {
04758           size_type size = map.size();
04759           int pysize = (size <= (size_type) INT_MAX) ? (int) size : -1;
04760           if (pysize < 0) {
04761             SWIG_PYTHON_THREAD_BEGIN_BLOCK;
04762             PyErr_SetString(PyExc_OverflowError,
04763                             "map size not valid in python");
04764             SWIG_PYTHON_THREAD_END_BLOCK;
04765             return NULL;
04766           }
04767           PyObject *obj = PyDict_New();
04768           for (const_iterator i= map.begin(); i!= map.end(); ++i) {
04769             swig::SwigVar_PyObject key = swig::from(i->first);
04770             swig::SwigVar_PyObject val = swig::from(i->second);
04771             PyDict_SetItem(obj, key, val);
04772           }
04773           return obj;
04774         }
04775       }


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