SyFi 0.3
|
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) |
Definition at line 4747 of file SyFi_wrap.cc.
typedef map_type::const_iterator swig::traits_from< std::map< K, T > >::const_iterator |
Definition at line 4749 of file SyFi_wrap.cc.
typedef std::map<K,T> swig::traits_from< std::map< K, T > >::map_type |
Definition at line 4748 of file SyFi_wrap.cc.
typedef map_type::size_type swig::traits_from< std::map< K, T > >::size_type |
Definition at line 4750 of file SyFi_wrap.cc.
static PyObject* swig::traits_from< std::map< K, T > >::from | ( | const map_type & | map | ) | [inline, static] |
Definition at line 4752 of file SyFi_wrap.cc.
References swig_type_info::clientdata, swig::from(), SWIG_NewPointerObj, SWIG_POINTER_OWN, SWIG_PYTHON_THREAD_BEGIN_BLOCK, and SWIG_PYTHON_THREAD_END_BLOCK.
{ swig_type_info *desc = swig::type_info<map_type>(); if (desc && desc->clientdata) { return SWIG_NewPointerObj(new map_type(map), desc, SWIG_POINTER_OWN); } else { SWIG_PYTHON_THREAD_BEGIN_BLOCK; size_type size = map.size(); int pysize = (size <= (size_type) INT_MAX) ? (int) size : -1; if (pysize < 0) { PyErr_SetString(PyExc_OverflowError, "map size not valid in python"); SWIG_PYTHON_THREAD_END_BLOCK; return NULL; } PyObject *obj = PyDict_New(); for (const_iterator i= map.begin(); i!= map.end(); ++i) { swig::SwigVar_PyObject key = swig::from(i->first); swig::SwigVar_PyObject val = swig::from(i->second); PyDict_SetItem(obj, key, val); } SWIG_PYTHON_THREAD_END_BLOCK; return obj; } }