| 1 | /* |
| 2 | Multisets |
| 3 | */ |
| 4 | |
| 5 | %include <std_set.i> |
| 6 | |
| 7 | %fragment("StdMultisetTraits","header",fragment="StdSequenceTraits") |
| 8 | %{ |
| 9 | namespace swig { |
| 10 | template <class PySeq, class T> |
| 11 | inline void |
| 12 | assign(const PySeq& pyseq, std::multiset<T>* seq) { |
| 13 | #ifdef SWIG_STD_NOINSERT_TEMPLATE_STL |
| 14 | typedef typename PySeq::value_type value_type; |
| 15 | typename PySeq::const_iterator it = pyseq.begin(); |
| 16 | for (;it != pyseq.end(); ++it) { |
| 17 | seq->insert(seq->end(),(value_type)(*it)); |
| 18 | } |
| 19 | #else |
| 20 | seq->insert(pyseq.begin(), pyseq.end()); |
| 21 | #endif |
| 22 | } |
| 23 | |
| 24 | template <class T> |
| 25 | struct traits_asptr<std::multiset<T> > { |
| 26 | static int asptr(PyObject *obj, std::multiset<T> **m) { |
| 27 | return traits_asptr_stdseq<std::multiset<T> >::asptr(obj, m); |
| 28 | } |
| 29 | }; |
| 30 | |
| 31 | template <class T> |
| 32 | struct traits_from<std::multiset<T> > { |
| 33 | static PyObject *from(const std::multiset<T>& vec) { |
| 34 | return traits_from_stdseq<std::multiset<T> >::from(vec); |
| 35 | } |
| 36 | }; |
| 37 | } |
| 38 | %} |
| 39 | |
| 40 | #define %swig_multiset_methods(Set...) %swig_set_methods(Set) |
| 41 | |
| 42 | |
| 43 | |
| 44 | %include <std/std_multiset.i> |