From 3a7af1c1e8d7650bf7cafba610df0c40e5cc0c18 Mon Sep 17 00:00:00 2001 From: khizmax Date: Wed, 27 Jan 2016 23:44:28 +0300 Subject: [PATCH] Doc fix --- cds/intrusive/basket_queue.h | 17 ++++++------ cds/intrusive/details/single_link_struct.h | 2 +- cds/intrusive/fcqueue.h | 8 +++--- cds/intrusive/moir_queue.h | 2 +- cds/intrusive/optimistic_queue.h | 31 +++++++++++----------- 5 files changed, 29 insertions(+), 31 deletions(-) diff --git a/cds/intrusive/basket_queue.h b/cds/intrusive/basket_queue.h index 3c0757f5..cdb99cc3 100644 --- a/cds/intrusive/basket_queue.h +++ b/cds/intrusive/basket_queue.h @@ -264,20 +264,19 @@ namespace cds { namespace intrusive { /// Metafunction converting option list to \p basket_queue::traits /** Supported \p Options are: - - - opt::hook - hook used. Possible hooks are: \p basket_queue::base_hook, \p basket_queue::member_hook, \p basket_queue::traits_hook. + - \p opt::hook - hook used. Possible hooks are: \p basket_queue::base_hook, \p basket_queue::member_hook, \p basket_queue::traits_hook. If the option is not specified, \p %basket_queue::base_hook<> is used. - - opt::back_off - back-off strategy used, default is \p cds::backoff::empty. - - opt::disposer - the functor used for dispose removed items. Default is \p opt::v::empty_disposer. This option is used + - \p opt::back_off - back-off strategy used, default is \p cds::backoff::empty. + - \p opt::disposer - the functor used for dispose removed items. Default is \p opt::v::empty_disposer. This option is used when dequeuing. - - opt::link_checker - the type of node's link fields checking. Default is \p opt::debug_check_link - - opt::item_counter - the type of item counting feature. Default is \p cds::atomicity::empty_item_counter (item counting disabled) + - \p opt::link_checker - the type of node's link fields checking. Default is \p opt::debug_check_link + - \p opt::item_counter - the type of item counting feature. Default is \p cds::atomicity::empty_item_counter (item counting disabled) To enable item counting use \p cds::atomicity::item_counter - - opt::stat - the type to gather internal statistics. + - \p opt::stat - the type to gather internal statistics. Possible statistics types are: \p basket_queue::stat, \p basket_queue::empty_stat, user-provided class that supports \p %basket_queue::stat interface. Default is \p %basket_queue::empty_stat (internal statistics disabled). - \p opt::padding - padding for internal critical atomic data. Default is \p opt::cache_line_padding - - opt::memory_model - C++ memory ordering model. Can be \p opt::v::relaxed_ordering (relaxed memory model, the default) + - \p opt::memory_model - C++ memory ordering model. Can be \p opt::v::relaxed_ordering (relaxed memory model, the default) or \p opt::v::sequential_consistent (sequentially consisnent memory model). Example: declare \p %BasketQueue with item counting and internal statistics @@ -343,7 +342,7 @@ namespace cds { namespace intrusive { of the backoff mechanisms to reduce contention, making the algorithm an attractive out-of-the-box queue. - In order to enqueue, just as in MSQueue, a thread first tries to link the new node to + In order to enqueue, just as in \p MSQueue, a thread first tries to link the new node to the last node. If it failed to do so, then another thread has already succeeded. Thus it tries to insert the new node into the new basket that was created by the winner thread. To dequeue a node, a thread first reads the head of the queue to obtain the diff --git a/cds/intrusive/details/single_link_struct.h b/cds/intrusive/details/single_link_struct.h index 9b942144..0ee4c60a 100644 --- a/cds/intrusive/details/single_link_struct.h +++ b/cds/intrusive/details/single_link_struct.h @@ -54,7 +54,7 @@ namespace cds { namespace intrusive { typedef GC gc ; ///< Garbage collector typedef Tag tag ; ///< tag - typedef typename gc::template atomic_ref atomic_node_ptr ; ///< atomic pointer + typedef typename gc::template atomic_ref atomic_node_ptr; ///< atomic pointer /// Rebind node for other template parameters template diff --git a/cds/intrusive/fcqueue.h b/cds/intrusive/fcqueue.h index c654053f..c369c371 100644 --- a/cds/intrusive/fcqueue.h +++ b/cds/intrusive/fcqueue.h @@ -38,10 +38,10 @@ namespace cds { namespace intrusive { - /// FCQueue related definitions + /// \p FCQueue related definitions namespace fcqueue { - /// FCQueue internal statistics + /// \p FCQueue internal statistics template struct stat: public cds::algo::flat_combining::stat { @@ -70,7 +70,7 @@ namespace cds { namespace intrusive { //@endcond }; - /// FCQueue type traits + /// \p FCQueue type traits struct traits: public cds::algo::flat_combining::traits { typedef cds::intrusive::opt::v::empty_disposer disposer ; ///< Disposer to erase removed elements. Used only in \p FCQueue::clear() function @@ -91,7 +91,7 @@ namespace cds { namespace intrusive { List of all available memory ordering see \p opt::memory_model. Default is \p cds::opt::v:relaxed_ordering - \p opt::enable_elimination - enable/disable operation \ref cds_elimination_description "elimination" - By default, the elimination is disabled. + By default, the elimination is disabled (\p false) */ template struct make_traits { diff --git a/cds/intrusive/moir_queue.h b/cds/intrusive/moir_queue.h index 7a194993..9a8d1242 100644 --- a/cds/intrusive/moir_queue.h +++ b/cds/intrusive/moir_queue.h @@ -51,7 +51,7 @@ namespace cds { namespace intrusive { frequently, our modification will reduce the number of accesses to global memory. This modification, however, introduces the possibility of \p Head and \p Tail 'crossing'." - Explanation of template arguments see intrusive::MSQueue. + Explanation of template arguments see \p intrusive::MSQueue. \par Examples \code diff --git a/cds/intrusive/optimistic_queue.h b/cds/intrusive/optimistic_queue.h index 2f05c1b4..461021e9 100644 --- a/cds/intrusive/optimistic_queue.h +++ b/cds/intrusive/optimistic_queue.h @@ -38,7 +38,7 @@ namespace cds { namespace intrusive { - /// OptimisticQueue related definitions + /// \p OptimisticQueue related definitions /** @ingroup cds_intrusive_helper */ namespace optimistic_queue { @@ -88,8 +88,8 @@ namespace cds { namespace intrusive { /// Base hook /** \p Options are: - - opt::gc - garbage collector used. - - opt::tag - a \ref cds_intrusive_hook_tag "tag" + - \p opt::gc - garbage collector used. + - \p opt::tag - a \ref cds_intrusive_hook_tag "tag" */ template < typename... Options > struct base_hook: public hook< opt::base_hook_tag, Options... > @@ -101,8 +101,8 @@ namespace cds { namespace intrusive { Use \p offsetof macro to define \p MemberOffset \p Options are: - - opt::gc - garbage collector used. - - opt::tag - a \ref cds_intrusive_hook_tag "tag" + - \p opt::gc - garbage collector used. + - \p opt::tag - a \ref cds_intrusive_hook_tag "tag" */ template < size_t MemberOffset, typename... Options > struct member_hook: public hook< opt::member_hook_tag, Options... > @@ -118,8 +118,8 @@ namespace cds { namespace intrusive { See \ref node_traits for \p NodeTraits interface description \p Options are: - - opt::gc - garbage collector used. - - opt::tag - a \ref cds_intrusive_hook_tag "tag" + - \p opt::gc - garbage collector used. + - \p opt::tag - a \ref cds_intrusive_hook_tag "tag" */ template struct traits_hook: public hook< opt::traits_hook_tag, Options... > @@ -174,11 +174,10 @@ namespace cds { namespace intrusive { }; //@endcond - /// OptimisticQueue internal statistics. May be used for debugging or profiling + /// \p OptimisticQueue internal statistics. May be used for debugging or profiling /** Template argument \p Counter defines type of counter. - Default is \p cds::atomicity::event_counter, that is weak, i.e. it is not guaranteed - strict event counting. + Default is \p cds::atomicity::event_counter. You may use stronger type of counter like as \p cds::atomicity::item_counter, or even integral type, for example, \p int. */ @@ -242,7 +241,7 @@ namespace cds { namespace intrusive { //@endcond }; - /// Dummy OptimisticQueue statistics - no counting is performed. Support interface like \ref optimistic_queue::stat + /// Dummy \p OptimisticQueue statistics - no counting is performed. Support interface like \p optimistic_queue::stat struct empty_stat { //@cond @@ -263,7 +262,7 @@ namespace cds { namespace intrusive { //@endcond }; - /// OptimisticQueue default type traits + /// \p OptimisticQueue default type traits struct traits { /// Back-off strategy @@ -447,6 +446,8 @@ namespace cds { namespace intrusive { typedef OptimisticQueue< GC2, T2, Traits2 > other ; ///< Rebinding result }; + static CDS_CONSTEXPR const size_t c_nHazardPtrCount = 5; ///< Count of hazard pointer required for the algorithm + protected: //@cond typedef typename node_type::atomic_node_ptr atomic_node_ptr; @@ -470,8 +471,6 @@ namespace cds { namespace intrusive { item_counter m_ItemCounter ; ///< Item counter stat m_Stat ; ///< Internal statistics - static CDS_CONSTEXPR const size_t c_nHazardPtrCount = 5 ; ///< Count of hazard pointer required for the algorithm - protected: //@cond static void clear_links( node_type * pNode ) @@ -646,10 +645,10 @@ namespace cds { namespace intrusive { | ... | \endcode - \p dequeue function returns Item 2, that becomes new top of queue, and calls + \p %dequeue() function returns Item 2, that becomes new top of queue, and calls the disposer for Item 1, that was queue's top on function entry. Thus, you cannot manually delete item returned because it is still included in - item sequence and it has valuable link field that must not be zeroed. + the queue and it has valuable link field that must not be zeroed. The item may be deleted only in disposer call. */ value_type * dequeue() -- 2.34.1