FCQueue refactoring
[libcds.git] / cds / intrusive / fcqueue.h
index 7fafe1d81243cc09726b1335a0806f4097d40181..366535d4de9d3a1f6d4407492d09bb854faf0c1e 100644 (file)
@@ -43,7 +43,7 @@ namespace cds { namespace intrusive {
         };
 
         /// FCQueue type traits
-        struct type_traits: public cds::algo::flat_combining::type_traits
+        struct traits: public cds::algo::flat_combining::type_traits
         {
             typedef cds::intrusive::opt::v::empty_disposer  disposer ; ///< Disposer to erase removed elements. Used only in \p FCQueue::clear() function
             typedef empty_stat      stat;   ///< Internal statistics
@@ -52,17 +52,16 @@ namespace cds { namespace intrusive {
 
         /// Metafunction converting option list to traits
         /**
-            This is a wrapper for <tt> cds::opt::make_options< type_traits, Options...> </tt>
             \p Options are:
             - \p opt::lock_type - mutex type, default is \p cds::lock::Spin
             - \p opt::back_off - back-off strategy, defalt is \p cds::backoff::Default
-            - \p opt::disposer - the functor used for dispose removed items. Default is opt::intrusive::v::empty_disposer.
+            - \p opt::disposer - the functor used for dispose removed items. Default is \p opt::intrusive::v::empty_disposer.
                 This option is used only in \p FCQueue::clear() function.
             - \p opt::allocator - allocator type, default is \ref CDS_DEFAULT_ALLOCATOR
-            - \p opt::stat - internal statistics, possible type: \ref stat, \ref empty_stat (the default)
+            - \p opt::stat - internal statistics, possible type: \p fcqueue::stat, \p fcqueue::empty_stat (the default)
             - \p opt::memory_model - C++ memory ordering model.
-                List of all available memory ordering see opt::memory_model.
-                Default if cds::opt::v:relaxed_ordering
+                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.
         */
@@ -72,7 +71,7 @@ namespace cds { namespace intrusive {
             typedef implementation_defined type ;   ///< Metafunction result
 #   else
             typedef typename cds::opt::make_options<
-                typename cds::opt::find_type_traits< type_traits, Options... >::type
+                typename cds::opt::find_type_traits< traits, Options... >::type
                 ,Options...
             >::type   type;
 #   endif
@@ -90,12 +89,12 @@ namespace cds { namespace intrusive {
         - \p T - a value type stored in the queue
         - \p Container - sequential intrusive container with \p push_back and \p pop_front functions.
             Default is \p boost::intrusive::list
-        - \p Traits - type traits of flat combining, default is \p fcqueue::type_traits.
-            \p fcqueue::make_traits metafunction can be used to construct specialized \p %type_traits
+        - \p Traits - type traits of flat combining, default is \p fcqueue::traits.
+            \p fcqueue::make_traits metafunction can be used to construct \p %fcqueue::traits specialization
     */
     template <typename T
         ,class Container = boost::intrusive::list<T>
-        ,typename Traits = fcqueue::type_traits
+        ,typename Traits = fcqueue::traits
     >
     class FCQueue
 #ifndef CDS_DOXYGEN_INVOKED
@@ -105,11 +104,11 @@ namespace cds { namespace intrusive {
     public:
         typedef T           value_type;     ///< Value type
         typedef Container   container_type; ///< Sequential container type
-        typedef Traits      type_traits;    ///< Queue type traits
+        typedef Traits      traits;         ///< Queue traits
 
-        typedef typename type_traits::disposer  disposer;   ///< The disposer functor. The disposer is used only in \ref clear() function
-        typedef typename type_traits::stat  stat;   ///< Internal statistics type
-        static CDS_CONSTEXPR_CONST bool c_bEliminationEnabled = type_traits::enable_elimination; ///< \p true if elimination is enabled
+        typedef typename traits::disposer   disposer;   ///< The disposer functor. The disposer is used only in \ref clear() function
+        typedef typename traits::stat       stat;   ///< Internal statistics type
+        static CDS_CONSTEXPR_CONST bool c_bEliminationEnabled = traits::enable_elimination; ///< \p true if elimination is enabled
 
     protected:
         //@cond
@@ -130,7 +129,7 @@ namespace cds { namespace intrusive {
         //@endcond
 
         /// Flat combining kernel
-        typedef cds::algo::flat_combining::kernel< fc_record, type_traits > fc_kernel;
+        typedef cds::algo::flat_combining::kernel< fc_record, traits > fc_kernel;
 
     protected:
         //@cond