|
SyFi
0.3
|
Public Types | |
| typedef std::map< K, T, Compare, Alloc > | map_type |
| typedef map_type::const_iterator | const_iterator |
| typedef map_type::size_type | size_type |
Static Public Member Functions | |
| static PyObject * | asdict (const map_type &map) |
| static PyObject * | from (const map_type &map) |
Definition at line 5228 of file SyFiPYTHON_wrap.cxx.
| typedef map_type::const_iterator swig::traits_from< std::map< K, T, Compare, Alloc > >::const_iterator |
Definition at line 5230 of file SyFiPYTHON_wrap.cxx.
| typedef std::map<K,T,Compare,Alloc > swig::traits_from< std::map< K, T, Compare, Alloc > >::map_type |
Definition at line 5229 of file SyFiPYTHON_wrap.cxx.
| typedef map_type::size_type swig::traits_from< std::map< K, T, Compare, Alloc > >::size_type |
Definition at line 5231 of file SyFiPYTHON_wrap.cxx.
| static PyObject* swig::traits_from< std::map< K, T, Compare, Alloc > >::asdict | ( | const map_type & | map | ) | [inline, static] |
Definition at line 5233 of file SyFiPYTHON_wrap.cxx.
References swig::from(), SWIG_PYTHON_THREAD_BEGIN_BLOCK, and SWIG_PYTHON_THREAD_END_BLOCK.
{
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;
}
| static PyObject* swig::traits_from< std::map< K, T, Compare, Alloc > >::from | ( | const map_type & | map | ) | [inline, static] |
Definition at line 5253 of file SyFiPYTHON_wrap.cxx.
References swig_type_info::clientdata, SWIG_InternalNewPointerObj, and SWIG_POINTER_OWN.
{
swig_type_info *desc = swig::type_info<map_type>();
if (desc && desc->clientdata) {
return SWIG_InternalNewPointerObj(new map_type(map), desc, SWIG_POINTER_OWN);
} else {
return asdict(map);
}
}