Docfix
authorkhizmax <libcds.dev@gmail.com>
Sun, 27 Mar 2016 19:51:46 +0000 (22:51 +0300)
committerkhizmax <libcds.dev@gmail.com>
Sun, 27 Mar 2016 19:51:46 +0000 (22:51 +0300)
cds/container/michael_map.h

index 38df3b84516fd1d50bad9513b03d66f1d59bc50d..bda80b716b6680427e0d8bc369f9d834a0298b67 100644 (file)
@@ -72,47 +72,6 @@ namespace cds { namespace container {
         - for \p cds::gc::nogc declared in <tt>cds/container/michael_map_nogc.h</tt>,
             see \ref cds_nonintrusive_MichaelHashMap_nogc "MichaelHashMap<gc::nogc>".
 
-        <b>Iterators</b>
-
-        The class supports a forward iterator (\ref iterator and \ref const_iterator).
-        The iteration is unordered.
-        The iterator object is thread-safe: the element pointed by the iterator object is guarded,
-        so, the element cannot be reclaimed while the iterator object is alive.
-        However, passing an iterator object between threads is dangerous.
-
-        @warning Due to concurrent nature of Michael's set it is not guarantee that you can iterate
-        all elements in the set: any concurrent deletion can exclude the element
-        pointed by the iterator from the set, and your iteration can be terminated
-        before end of the set. Therefore, such iteration is more suitable for debugging purpose only
-
-        Remember, each iterator object requires an additional hazard pointer, that may be
-        a limited resource for \p GC like \p gc::HP (for \p gc::DHP the count of
-        guards is unlimited).
-
-        The iterator class supports the following minimalistic interface:
-        \code
-        struct iterator {
-        // Default ctor
-        iterator();
-
-        // Copy ctor
-        iterator( iterator const& s);
-
-        value_type * operator ->() const;
-        value_type& operator *() const;
-
-        // Pre-increment
-        iterator& operator ++();
-
-        // Copy assignment
-        iterator& operator = (const iterator& src);
-
-        bool operator ==(iterator const& i ) const;
-        bool operator !=(iterator const& i ) const;
-        };
-        \endcode
-        Note, the iterator object returned by \ref end, \p cend member functions points to \p nullptr and should not be dereferenced.
-
         \anchor cds_nonintrusive_MichaelHashMap_how_touse
         <b>How to use</b>
 
@@ -206,6 +165,8 @@ namespace cds { namespace container {
         typedef cds::details::Allocator< bucket_type, typename traits::allocator >  bucket_table_allocator;
         typedef typename bucket_type::guarded_ptr  guarded_ptr; ///< Guarded pointer
 
+        static CDS_CONSTEXPR const size_t c_nHazardPtrCount = bucket_type::c_nHazardPtrCount; ///< Count of hazard pointer required
+
     protected:
         item_counter    m_ItemCounter; ///< Item counter
         hash            m_HashFunctor; ///< Hash functor
@@ -323,7 +284,49 @@ namespace cds { namespace container {
         //@endcond
 
     public:
+    ///@name Forward iterators (only for debugging purpose)
+    //@{
         /// Forward iterator
+        /**
+            The iteration is unordered.
+            The iterator object is thread-safe: the element pointed by the iterator object is guarded,
+            so, the element cannot be reclaimed while the iterator object is alive.
+            However, passing an iterator object between threads is dangerous.
+
+            @warning Due to concurrent nature of Michael's map it is not guarantee that you can iterate
+            all elements in the map: any concurrent deletion can exclude the element
+            pointed by the iterator from the map, and your iteration can be terminated
+            before end of the map. Therefore, such iteration is more suitable for debugging purpose only.
+
+            Remember, each iterator object requires an additional hazard pointer, that may be
+            a limited resource for \p GC like \p gc::HP (for \p gc::DHP the count of
+            guards is unlimited).
+
+            The iterator class supports the following minimalistic interface:
+            \code
+            struct iterator {
+                // Default ctor
+                iterator();
+
+                // Copy ctor
+                iterator( iterator const& s);
+
+                value_type * operator ->() const;
+                value_type& operator *() const;
+
+                // Pre-increment
+                iterator& operator ++();
+
+                // Copy assignment
+                iterator& operator = (iterator const& src);
+
+                bool operator ==(iterator const& i ) const;
+                bool operator !=(iterator const& i ) const;
+            };
+            \endcode
+
+            Note, the iterator object returned by \p end(), \p cend() member functions points to \p nullptr and should not be dereferenced.
+        */
         typedef iterator_type< false >    iterator;
 
         /// Const forward iterator
@@ -350,28 +353,27 @@ namespace cds { namespace container {
         }
 
         /// Returns a forward const iterator addressing the first element in a map
-        //@{
         const_iterator begin() const
         {
             return get_const_begin();
         }
+        /// Returns a forward const iterator addressing the first element in a map
         const_iterator cbegin() const
         {
             return get_const_begin();
         }
-        //@}
 
         /// Returns an const iterator that addresses the location succeeding the last element in a map
-        //@{
         const_iterator end() const
         {
             return get_const_end();
         }
+        /// Returns an const iterator that addresses the location succeeding the last element in a map
         const_iterator cend() const
         {
             return get_const_end();
         }
-        //@}
+    //@}
 
     private:
         //@cond