From: khizmax Date: Tue, 11 Nov 2014 18:28:21 +0000 (+0300) Subject: rename type_traits to traits in flat_combining namespace X-Git-Tag: v2.0.0~114 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=libcds.git;a=commitdiff_plain;h=9602ba9ad7c3798847d35bfbdf2eb3a2cc051420 rename type_traits to traits in flat_combining namespace --- diff --git a/cds/algo/flat_combining.h b/cds/algo/flat_combining.h index a018a4a9..486fe724 100644 --- a/cds/algo/flat_combining.h +++ b/cds/algo/flat_combining.h @@ -179,10 +179,10 @@ namespace cds { namespace algo { /// Type traits of \ref kernel class /** You can define different type traits for \ref kernel - by specifying your struct based on \p %type_traits + by specifying your struct based on \p %traits or by using \ref make_traits metafunction. */ - struct type_traits + struct traits { typedef cds::lock::Spin lock_type; ///< Lock type typedef cds::backoff::delay_of<2> back_off; ///< Back-off strategy @@ -193,7 +193,6 @@ namespace cds { namespace algo { /// Metafunction converting option list to traits /** - This is a wrapper for cds::opt::make_options< type_traits, Options...> \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::delay_of<2> @@ -209,7 +208,7 @@ namespace cds { namespace algo { 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 @@ -219,7 +218,7 @@ namespace cds { namespace algo { /** Template parameters: - \p PublicationRecord - a type derived from \ref publication_record - - \p Traits - a type traits of flat combining, default is flat_combining::type_traits. + - \p Traits - a type traits of flat combining, default is \p flat_combining::traits. \ref make_traits metafunction can be used to create type traits The kernel object should be a member of a container class. The container cooperates with flat combining @@ -243,18 +242,18 @@ namespace cds { namespace algo { */ template < typename PublicationRecord - ,typename Traits = type_traits + ,typename Traits = traits > class kernel { public: - typedef PublicationRecord publication_record_type; ///< publication record type - typedef Traits type_traits; ///< Type traits - typedef typename type_traits::lock_type global_lock_type; ///< Global lock type - typedef typename type_traits::back_off back_off; ///< back-off strategy type - typedef typename type_traits::allocator allocator; ///< Allocator type (used for allocating publication_record_type data) - typedef typename type_traits::stat stat; ///< Internal statistics - typedef typename type_traits::memory_model memory_model; ///< C++ memory model + typedef PublicationRecord publication_record_type; ///< publication record type + typedef Traits traits; ///< Type traits + typedef typename traits::lock_type global_lock_type; ///< Global lock type + typedef typename traits::back_off back_off; ///< back-off strategy type + typedef typename traits::allocator allocator; ///< Allocator type (used for allocating publication_record_type data) + typedef typename traits::stat stat; ///< Internal statistics + typedef typename traits::memory_model memory_model; ///< C++ memory model protected: //@cond diff --git a/cds/container/fcdeque.h b/cds/container/fcdeque.h index 7b4fd422..481ee425 100644 --- a/cds/container/fcdeque.h +++ b/cds/container/fcdeque.h @@ -57,7 +57,7 @@ namespace cds { namespace container { }; /// FCDeque type traits - struct traits: public cds::algo::flat_combining::type_traits + struct traits: public cds::algo::flat_combining::traits { typedef empty_stat stat; ///< Internal statistics static CDS_CONSTEXPR const bool enable_elimination = false; ///< Enable \ref cds_elimination_description "elimination" diff --git a/cds/container/fcpriority_queue.h b/cds/container/fcpriority_queue.h index 7d211d4b..9707ce04 100644 --- a/cds/container/fcpriority_queue.h +++ b/cds/container/fcpriority_queue.h @@ -44,7 +44,7 @@ namespace cds { namespace container { }; /// FCPriorityQueue traits - struct traits: public cds::algo::flat_combining::type_traits + struct traits: public cds::algo::flat_combining::traits { typedef empty_stat stat; ///< Internal statistics }; diff --git a/cds/container/fcqueue.h b/cds/container/fcqueue.h index ce0301be..f0694878 100644 --- a/cds/container/fcqueue.h +++ b/cds/container/fcqueue.h @@ -47,7 +47,7 @@ namespace cds { namespace container { }; /// FCQueue type traits - struct traits: public cds::algo::flat_combining::type_traits + struct traits: public cds::algo::flat_combining::traits { typedef empty_stat stat; ///< Internal statistics static CDS_CONSTEXPR const bool enable_elimination = false; ///< Enable \ref cds_elimination_description "elimination" diff --git a/cds/container/fcstack.h b/cds/container/fcstack.h index f358968a..0dbf5a8f 100644 --- a/cds/container/fcstack.h +++ b/cds/container/fcstack.h @@ -47,7 +47,7 @@ namespace cds { namespace container { }; /// FCStack type traits - struct traits: public cds::algo::flat_combining::type_traits + struct traits: public cds::algo::flat_combining::traits { typedef empty_stat stat; ///< Internal statistics static CDS_CONSTEXPR const bool enable_elimination = false; ///< Enable \ref cds_elimination_description "elimination" diff --git a/cds/intrusive/fcqueue.h b/cds/intrusive/fcqueue.h index b0bef107..f076b63e 100644 --- a/cds/intrusive/fcqueue.h +++ b/cds/intrusive/fcqueue.h @@ -43,7 +43,7 @@ namespace cds { namespace intrusive { }; /// FCQueue type traits - struct traits: public cds::algo::flat_combining::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 typedef empty_stat stat; ///< Internal statistics diff --git a/cds/intrusive/fcstack.h b/cds/intrusive/fcstack.h index 4a334d15..b372a4d9 100644 --- a/cds/intrusive/fcstack.h +++ b/cds/intrusive/fcstack.h @@ -43,7 +43,7 @@ namespace cds { namespace intrusive { }; /// FCStack type traits - struct traits: public cds::algo::flat_combining::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 FCStack::clear() function typedef empty_stat stat; ///< Internal statistics