ptr_multiset_adapter.rst 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. ++++++++++++++++++++++++++++++++++
  2. |Boost| Pointer Container Library
  3. ++++++++++++++++++++++++++++++++++
  4. .. |Boost| image:: boost.png
  5. Class ``ptr_multiset_adapter``
  6. ------------------------------
  7. This class is used to build custom pointer containers with
  8. an underlying multiset-like container. The interface of the class is an extension
  9. of the interface from ``associative_ptr_container``.
  10. **Hierarchy:**
  11. - `reversible_ptr_container <reversible_ptr_container.html>`_
  12. - `associative_ptr_container <associative_ptr_container.html>`_
  13. - `ptr_set_adapter <ptr_set_adapter.html>`_
  14. - ``ptr_multiset_adapter``
  15. - `ptr_map_adapter <ptr_map_adapter.html>`_
  16. - `ptr_multi_map_adapter <ptr_multimap_adapter.html>`_
  17. - `ptr_set <ptr_set.html>`_
  18. - `ptr_multi_set <ptr_multiset.html>`_
  19. - `ptr_map <ptr_map.html>`_
  20. - `ptr_multimap <ptr_multimap.html>`_
  21. **Navigate:**
  22. - `home <ptr_container.html>`_
  23. - `reference <reference.html>`_
  24. **Synopsis:**
  25. .. parsed-literal::
  26. namespace boost
  27. {
  28. template
  29. <
  30. class Key,
  31. class VoidPtrMultiSet,
  32. class CloneAllocator = heap_clone_allocator
  33. >
  34. class ptr_multiset_adapter
  35. {
  36. public: // `modifiers`_
  37. iterator insert( Key* x );
  38. template< class Key2 >
  39. iterator insert( compatible-smart-ptr<Key2> x );
  40. public: // `pointer container requirements`_
  41. void transfer( iterator object, ptr_multiset_adapter& from );
  42. size_type transfer( iterator first, iterator last, ptr_multiset_adapter& from );
  43. template< class Range >
  44. size_type transfer( const Range& r, ptr_multiset_adapter& from );
  45. void transfer( ptr_multiset_adapter& from );
  46. }; // class 'ptr_multiset_adapter'
  47. } // namespace 'boost'
  48. Semantics
  49. ---------
  50. .. _`modifiers`:
  51. Semantics: modifiers
  52. ^^^^^^^^^^^^^^^^^^^^
  53. - ``iterator insert( key_type* x );``
  54. - Requirements: ``x != 0``
  55. - Effects: Takes ownership of ``x``. The returned iterator points to the element with key ``x``.
  56. - Throws: bad_pointer if ``x == 0``
  57. - Exception safety: Strong guarantee
  58. - ``template< class Key2 > iterator insert( compatible-smart-ptr<Key2> x );``
  59. - Effects: ``return insert( x.release() );``
  60. ..
  61. - ``iterator insert( const key_type& x );``
  62. - Effects: ``return insert( allocate_clone( x ) );``
  63. - Exception safety: Strong guarantee
  64. .. _`pointer container requirements`:
  65. Semantics: pointer container requirements
  66. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  67. - ``void transfer( iterator object, ptr_multiset_adapter& from );``
  68. - Requirements: ``not from.empty()``
  69. - Effects: Inserts the object defined by ``object`` into the container and remove it from ``from``.
  70. - Postconditions: ``size()`` is one more, ``from.size()`` is one less.
  71. - Exception safety: Strong guarantee
  72. - ``void transfer( iterator first, iterator last, ptr_multiset_adapter& from );``
  73. - Requirements: ``not from.empty()``
  74. - Effects: Inserts the objects defined by the range ``[first,last)`` into the container and remove it from ``from``.
  75. - Postconditions: Let ``N == std::distance(first,last);`` then ``size()`` is ``N`` more, ``from.size()`` is ``N`` less.
  76. - Exception safety: Basic guarantee
  77. - ``template< class Range > void transfer( const Range& r, ptr_multiset_adapter& from );``
  78. - Effects: ``transfer( boost::begin(r), boost::end(r), from );``
  79. - ``void transfer( ptr_multiset_adapter& from );``
  80. - Effects: ``transfer( from.begin(), from.end(), from );``.
  81. - Postconditions: ``from.empty();``
  82. - Exception safety: Basic guarantee
  83. .. raw:: html
  84. <hr>
  85. :Copyright: Thorsten Ottosen 2004-2006. Use, modification and distribution is subject to the Boost Software License, Version 1.0 (see LICENSE_1_0.txt__).
  86. __ http://www.boost.org/LICENSE_1_0.txt