~ubuntu-branches/ubuntu/maverick/swig1.3/maverick

« back to all changes in this revision

Viewing changes to Lib/std/std_multiset.i

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-09-01 18:35:55 UTC
  • mfrom: (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050901183555-eq59uwhq8b62e44c
Tags: 1.3.24-1ubuntu4
* Use php5-dev instead of php4-dev, to kick php4 out of main.
* Drop support for generation of pike bindings, as nothing uses it,
  and swig is the only thing keeping pike7.6 in main (Ubuntu #13796)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
// std::set
 
3
//
 
4
 
 
5
%include <std_set.i>
 
6
 
 
7
// Multiset
 
8
 
 
9
%define %std_multiset_methods(multiset...)
 
10
  %std_set_methods_common(multiset);
 
11
  #ifdef SWIG_EXPORT_ITERATOR_METHODS
 
12
  pair<iterator,bool> insert(iterator pos);
 
13
  #endif
 
14
%enddef
 
15
 
 
16
 
 
17
// ------------------------------------------------------------------------
 
18
// std::multiset
 
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::multiset<T>), f(const std::multiset<T>&):
 
24
//      the parameter being read-only, either a sequence or a
 
25
//      previously wrapped std::multiset<T> can be passed.
 
26
//   -- f(std::multiset<T>&), f(std::multiset<T>*):
 
27
//      the parameter may be modified; therefore, only a wrapped std::multiset
 
28
//      can be passed.
 
29
//   -- std::multiset<T> f(), const std::multiset<T>& f():
 
30
//      the set is returned by copy; therefore, a sequence of T:s 
 
31
//      is returned which is most easily used in other functions
 
32
//   -- std::multiset<T>& f(), std::multiset<T>* f():
 
33
//      the set is returned by reference; therefore, a wrapped std::multiset
 
34
//      is returned
 
35
//   -- const std::multiset<T>* f(), f(const std::multiset<T>*):
 
36
//      for consistency, they expect and return a plain set pointer.
 
37
// ------------------------------------------------------------------------
 
38
 
 
39
 
 
40
// exported classes
 
41
 
 
42
namespace std {
 
43
 
 
44
  //multiset
 
45
 
 
46
  template <class _Key, class _Compare = less<_Key>,
 
47
            class _Alloc = allocator<_Key> >
 
48
  class multiset {
 
49
  public:
 
50
    typedef size_t size_type;
 
51
    typedef ptrdiff_t difference_type;
 
52
    typedef _Key value_type;
 
53
    typedef _Key key_type;
 
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
 
 
62
    %fragment(SWIG_Traits_frag(std::multiset<_Key, _Compare, _Alloc >), "header",
 
63
              fragment=SWIG_Traits_frag(_Key),
 
64
              fragment="StdMultisetTraits") {
 
65
      namespace swig {
 
66
        template <>  struct traits<std::multiset<_Key, _Compare, _Alloc > > {
 
67
          typedef pointer_category category;
 
68
          static const char* type_name() {
 
69
            return "std::multiset<" #_Key "," #_Alloc " >";
 
70
          }
 
71
        };
 
72
      }
 
73
    }
 
74
 
 
75
    %typemap_traits_ptr(SWIG_TYPECHECK_MULTISET, std::multiset<_Key, _Compare, _Alloc >);
 
76
  
 
77
    %std_multiset_methods(multiset);
 
78
 
 
79
#ifdef %swig_multiset_methods
 
80
    // Add swig/language extra methods
 
81
    %swig_multiset_methods(std::multiset<_Key, _Compare, _Alloc >);
 
82
#endif
 
83
  };
 
84
}