SyFi  0.3
swig::traits_from< std::map< K, T, Compare, Alloc > > Struct Template Reference

List of all members.

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)

Detailed Description

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

Definition at line 5079 of file SyFiPYTHON_wrap.cxx.


Member Typedef Documentation

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

Definition at line 5081 of file SyFiPYTHON_wrap.cxx.

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

Definition at line 5080 of file SyFiPYTHON_wrap.cxx.

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

Definition at line 5082 of file SyFiPYTHON_wrap.cxx.


Member Function Documentation

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

Definition at line 5084 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;
      }
template<class K , class T , class Compare , class Alloc >
static PyObject* swig::traits_from< std::map< K, T, Compare, Alloc > >::from ( const map_type map) [inline, static]

Definition at line 5104 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);
        }
      }

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