SyFi 0.3
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 4747 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 4749 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 4748 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 4750 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 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;
        }
      }

The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines