PageRenderTime 51ms CodeModel.GetById 23ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Lib/std/std_multiset.i

#
Swig | 83 lines | 67 code | 16 blank | 0 comment | 0 complexity | 38bc86dea4ad477d8340c8082e75d629 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. //
  2. // std::set
  3. //
  4. %include <std_set.i>
  5. // Multiset
  6. %define %std_multiset_methods(multiset...)
  7. %std_set_methods_common(multiset);
  8. %enddef
  9. // ------------------------------------------------------------------------
  10. // std::multiset
  11. //
  12. // const declarations are used to guess the intent of the function being
  13. // exported; therefore, the following rationale is applied:
  14. //
  15. // -- f(std::multiset<T>), f(const std::multiset<T>&):
  16. // the parameter being read-only, either a sequence or a
  17. // previously wrapped std::multiset<T> can be passed.
  18. // -- f(std::multiset<T>&), f(std::multiset<T>*):
  19. // the parameter may be modified; therefore, only a wrapped std::multiset
  20. // can be passed.
  21. // -- std::multiset<T> f(), const std::multiset<T>& f():
  22. // the set is returned by copy; therefore, a sequence of T:s
  23. // is returned which is most easily used in other functions
  24. // -- std::multiset<T>& f(), std::multiset<T>* f():
  25. // the set is returned by reference; therefore, a wrapped std::multiset
  26. // is returned
  27. // -- const std::multiset<T>* f(), f(const std::multiset<T>*):
  28. // for consistency, they expect and return a plain set pointer.
  29. // ------------------------------------------------------------------------
  30. // exported classes
  31. namespace std {
  32. //multiset
  33. template <class _Key, class _Compare = std::less<_Key>,
  34. class _Alloc = allocator<_Key> >
  35. class multiset {
  36. public:
  37. typedef size_t size_type;
  38. typedef ptrdiff_t difference_type;
  39. typedef _Key value_type;
  40. typedef _Key key_type;
  41. typedef value_type* pointer;
  42. typedef const value_type* const_pointer;
  43. typedef value_type& reference;
  44. typedef const value_type& const_reference;
  45. typedef _Alloc allocator_type;
  46. %traits_swigtype(_Key);
  47. %fragment(SWIG_Traits_frag(std::multiset<_Key, _Compare, _Alloc >), "header",
  48. fragment=SWIG_Traits_frag(_Key),
  49. fragment="StdMultisetTraits") {
  50. namespace swig {
  51. template <> struct traits<std::multiset<_Key, _Compare, _Alloc > > {
  52. typedef pointer_category category;
  53. static const char* type_name() {
  54. return "std::multiset<" #_Key "," #_Compare "," #_Alloc " >";
  55. }
  56. };
  57. }
  58. }
  59. %typemap_traits_ptr(SWIG_TYPECHECK_MULTISET, std::multiset<_Key, _Compare, _Alloc >);
  60. multiset( const _Compare& );
  61. #ifdef %swig_multiset_methods
  62. // Add swig/language extra methods
  63. %swig_multiset_methods(std::multiset<_Key, _Compare, _Alloc >);
  64. #endif
  65. %std_multiset_methods(multiset);
  66. };
  67. }