1 ++++++++++++++++++++++++++++++++++
2 |Boost| Pointer Container Library
3 ++++++++++++++++++++++++++++++++++
5 .. |Boost| image:: boost.png
7 Class ``ptr_set_adapter``
8 -------------------------
10 This class is used to build custom pointer containers with
11 an underlying set-like container. The interface of the class is an extension
12 of the interface from ``associative_ptr_container``.
16 - `reversible_ptr_container <reversible_ptr_container.html>`_
18 - `associative_ptr_container <associative_ptr_container.html>`_
21 - `ptr_multiset_adapter <ptr_multiset_adapter.html>`_
22 - `ptr_map_adapter <ptr_map_adapter.html>`_
23 - `ptr_multi_map_adapter <ptr_multimap_adapter.html>`_
25 - `ptr_set <ptr_set.html>`_
26 - `ptr_multi_set <ptr_multiset.html>`_
27 - `ptr_map <ptr_map.html>`_
28 - `ptr_multimap <ptr_multimap.html>`_
32 - `home <ptr_container.html>`_
33 - `reference <reference.html>`_
35 .. _reversible_ptr_container: reversible_ptr_container.html
36 .. _associative_ptr_container: associative_ptr_container.html
37 .. _ptr_set: ptr_set.html
50 class CloneAllocator = heap_clone_allocator
55 public: // `modifiers`_
56 std::pair<iterator,bool> insert( Key* x );
57 template< class Key2 >
58 std::pair<iterator,bool> insert( std::auto_ptr<Key2> x );
60 public: // `pointer container requirements`_
61 bool transfer( iterator object, ptr_set_adapter& from );
62 size_type transfer( iterator first, iterator last, ptr_set_adapter& from );
63 template< class Range >
64 size_type transfer( const Range& r, ptr_set_adapter& from );
65 size_type transfer( ptr_set_adapter& from );
67 }; // class 'ptr_set_adapter'
69 } // namespace 'boost'
80 - ``std::pair<iterator,bool> insert( key_type* x );``
82 - Requirements: ``x != 0``
84 - Effects: Takes ownership of ``x`` and insert it if there is no equivalent of it already. The ``bool`` part of the return value indicates insertion and the iterator points to the element with key ``x``.
86 - Throws: bad_pointer if ``x == 0``
88 - Exception safety: Strong guarantee
90 - ``template< class Key2 > std::pair<iterator,bool> insert( std::auto_ptr<Key2> x );``
92 - Effects: ``return insert( x.release() );``
96 - ``std::pair<iterator,bool> insert( const key_type& x );``
98 - Effects: ``return insert( allocate_clone( x ) );``
100 - Exception safety: Strong guarantee
102 .. _`pointer container requirements`:
104 Semantics: pointer container requirements
105 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
107 - ``bool transfer( iterator object, ptr_set_adapter& from );``
109 - Requirements: ``not from.empty()``
111 - Effects: Inserts the object defined by ``object`` into the container and remove it from ``from``
112 iff no equivalent object exists.
114 - Returns: whether the object was transfered
116 - Exception safety: Strong guarantee
118 - ``void transfer( iterator first, iterator last, ptr__set_adapter& from );``
120 - Requirements: ``not from.empty()``
122 - Effects: Inserts the objects defined by the range ``[first,last)`` into the container and remove it from ``from``.
123 An object is only transferred if no equivalent object exists.
125 - Returns: the number of transfered objects
127 - Exception safety: Basic guarantee
129 - ``template< class Range > void transfer( const Range& r, ptr_set_adapter& from );``
131 - Effects: ``return transfer( boost::begin(r), boost::end(r), from );``
133 - ``size_type transfer( ptr_set_adapter& from );``
135 - Effects: ``return transfer( from.begin(), from.end(), from );``.
141 :Copyright: Thorsten Ottosen 2004-2006. Use, modification and distribution is subject to the Boost Software License, Version 1.0 (see LICENSE_1_0.txt__).
143 __ http://www.boost.org/LICENSE_1_0.txt