OLD | NEW |
(Empty) | |
| 1 // |
| 2 // std::map |
| 3 // |
| 4 |
| 5 %include <std_map.i> |
| 6 |
| 7 |
| 8 %define %std_multimap_methods(mmap...) |
| 9 %std_map_methods_common(mmap); |
| 10 |
| 11 #ifdef SWIG_EXPORT_ITERATOR_METHODS |
| 12 std::pair<iterator,iterator> equal_range(const key_type& x); |
| 13 std::pair<const_iterator,const_iterator> equal_range(const key_type& x) const; |
| 14 #endif |
| 15 %enddef |
| 16 |
| 17 // ------------------------------------------------------------------------ |
| 18 // std::multimap |
| 19 // |
| 20 // const declarations are used to guess the intent of the function being |
| 21 // exported; therefore, the following rationale is applied: |
| 22 // |
| 23 // -- f(std::multimap<T>), f(const std::multimap<T>&): |
| 24 // the parameter being read-only, either a sequence or a |
| 25 // previously wrapped std::multimap<T> can be passed. |
| 26 // -- f(std::multimap<T>&), f(std::multimap<T>*): |
| 27 // the parameter may be modified; therefore, only a wrapped std::multimap |
| 28 // can be passed. |
| 29 // -- std::multimap<T> f(), const std::multimap<T>& f(): |
| 30 // the map is returned by copy; therefore, a sequence of T:s |
| 31 // is returned which is most easily used in other functions |
| 32 // -- std::multimap<T>& f(), std::multimap<T>* f(): |
| 33 // the map is returned by reference; therefore, a wrapped std::multimap |
| 34 // is returned |
| 35 // -- const std::multimap<T>* f(), f(const std::multimap<T>*): |
| 36 // for consistency, they expect and return a plain map pointer. |
| 37 // ------------------------------------------------------------------------ |
| 38 |
| 39 |
| 40 // exported class |
| 41 |
| 42 |
| 43 namespace std { |
| 44 template<class _Key, class _Tp, class _Compare = std::less<_Key >, |
| 45 class _Alloc = allocator<std::pair<const _Key, _Tp > > > |
| 46 class multimap { |
| 47 public: |
| 48 typedef size_t size_type; |
| 49 typedef ptrdiff_t difference_type; |
| 50 typedef _Key key_type; |
| 51 typedef _Tp mapped_type; |
| 52 typedef std::pair<const _Key, _Tp> value_type; |
| 53 |
| 54 typedef value_type* pointer; |
| 55 typedef const value_type* const_pointer; |
| 56 typedef value_type& reference; |
| 57 typedef const value_type& const_reference; |
| 58 typedef _Alloc allocator_type; |
| 59 |
| 60 %traits_swigtype(_Key); |
| 61 %traits_swigtype(_Tp); |
| 62 |
| 63 %fragment(SWIG_Traits_frag(std::multimap<_Key, _Tp, _Compare, _Alloc >), "he
ader", |
| 64 fragment=SWIG_Traits_frag(std::pair<_Key, _Tp >), |
| 65 fragment="StdMultimapTraits") { |
| 66 namespace swig { |
| 67 template <> struct traits<std::multimap<_Key, _Tp, _Compare, _Alloc > >
{ |
| 68 typedef pointer_category category; |
| 69 static const char* type_name() { |
| 70 return "std::multimap<" #_Key "," #_Tp "," #_Compare "," #_Alloc " >
"; |
| 71 } |
| 72 }; |
| 73 } |
| 74 } |
| 75 |
| 76 %typemap_traits_ptr(SWIG_TYPECHECK_MULTIMAP, std::multimap<_Key, _Tp, _Compa
re, _Alloc >); |
| 77 |
| 78 multimap( const _Compare& ); |
| 79 |
| 80 #ifdef %swig_multimap_methods |
| 81 // Add swig/language extra methods |
| 82 %swig_multimap_methods(std::multimap<_Key, _Tp, _Compare, _Alloc >); |
| 83 #endif |
| 84 |
| 85 %std_multimap_methods(multimap); |
| 86 }; |
| 87 } |
OLD | NEW |