From: khizmax Date: Sat, 27 Sep 2014 19:03:50 +0000 (+0400) Subject: Move michael_list_base.h from cds/container to cds/container/details X-Git-Tag: v2.0.0~263 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=58cd5ed861249381cdf697ef5b82a64e0f9e4ad3;p=libcds.git Move michael_list_base.h from cds/container to cds/container/details --- diff --git a/cds/container/details/michael_list_base.h b/cds/container/details/michael_list_base.h new file mode 100644 index 00000000..c30785ee --- /dev/null +++ b/cds/container/details/michael_list_base.h @@ -0,0 +1,112 @@ +//$$CDS-header$$ + +#ifndef __CDS_CONTAINER_DETAILS_MICHAEL_LIST_BASE_H +#define __CDS_CONTAINER_DETAILS_MICHAEL_LIST_BASE_H + +#include +#include +#include + +namespace cds { namespace container { + + /// MichaelList ordered list related definitions + /** @ingroup cds_nonintrusive_helper + */ + namespace michael_list { + /// Michael list default type traits + struct type_traits + { + typedef CDS_DEFAULT_ALLOCATOR allocator ; ///< allocator used to allocate new node + + /// Key comparison functor + /** + No default functor is provided. If the option is not specified, the \p less is used. + */ + typedef opt::none compare; + + /// specifies binary predicate used for key comparison. + /** + Default is \p std::less. + */ + typedef opt::none less; + + /// back-off strategy used + /** + If the option is not specified, the cds::backoff::empty is used. + */ + typedef cds::backoff::empty back_off; + + /// Item counter + /** + The type for item counting feature. + Default is no item counter (\ref atomicity::empty_item_counter) + */ + typedef atomicity::empty_item_counter item_counter; + + /// Link fields checking feature + /** + Default is \ref intrusive::opt::debug_check_link + */ + static const opt::link_check_type link_checker = opt::debug_check_link; + + /// C++ memory ordering model + /** + List of available memory ordering see opt::memory_model + */ + typedef opt::v::relaxed_ordering memory_model; + + /// RCU deadlock checking policy (only for \ref cds_intrusive_MichaelList_rcu "RCU-based MichaelList") + /** + List of available options see opt::rcu_check_deadlock + */ + typedef opt::v::rcu_throw_deadlock rcu_check_deadlock; + + //@cond + // MichaelKVList: supporting for split-ordered list + // key accessor (opt::none = internal key type is equal to user key type) + typedef opt::none key_accessor; + //@endcond + }; + + /// Metafunction converting option list to MichaelList traits + /** + This is a wrapper for cds::opt::make_options< type_traits, Options...> + + See \ref MichaelList, \ref type_traits, \ref cds::opt::make_options. + */ + template + struct make_traits { +# ifdef CDS_DOXYGEN_INVOKED + typedef implementation_defined type ; ///< Metafunction result +# else + typedef typename cds::opt::make_options< + typename cds::opt::find_type_traits< type_traits, Options... >::type + ,Options... + >::type type; +#endif + }; + + + } // namespace michael_list + + // Forward declarations + template + class MichaelList; + + template + class MichaelKVList; + + // Tag for selecting Michael's list implementation + /** + This struct is empty and it is used only as a tag for selecting MichaelList + as ordered list implementation in declaration of some classes. + + See split_list::type_traits::ordered_list as an example. + */ + struct michael_list_tag + {}; + +}} // namespace cds::container + + +#endif // #ifndef __CDS_CONTAINER_DETAILS_MICHAEL_LIST_BASE_H diff --git a/cds/container/michael_kvlist_hp.h b/cds/container/michael_kvlist_hp.h index 59056ed6..3da99256 100644 --- a/cds/container/michael_kvlist_hp.h +++ b/cds/container/michael_kvlist_hp.h @@ -3,7 +3,7 @@ #ifndef __CDS_CONTAINER_MICHAEL_KVLIST_HP_H #define __CDS_CONTAINER_MICHAEL_KVLIST_HP_H -#include +#include #include #include #include diff --git a/cds/container/michael_kvlist_hrc.h b/cds/container/michael_kvlist_hrc.h index 9a6803bb..8d0e4a1f 100644 --- a/cds/container/michael_kvlist_hrc.h +++ b/cds/container/michael_kvlist_hrc.h @@ -3,7 +3,7 @@ #ifndef __CDS_CONTAINER_MICHAEL_KVLIST_HRC_H #define __CDS_CONTAINER_MICHAEL_KVLIST_HRC_H -#include +#include #include #include #include diff --git a/cds/container/michael_kvlist_nogc.h b/cds/container/michael_kvlist_nogc.h index 5a42a8f5..bae83d1b 100644 --- a/cds/container/michael_kvlist_nogc.h +++ b/cds/container/michael_kvlist_nogc.h @@ -4,7 +4,7 @@ #define __CDS_CONTAINER_MICHAEL_KVLIST_NOGC_H #include -#include +#include #include #include #include diff --git a/cds/container/michael_kvlist_ptb.h b/cds/container/michael_kvlist_ptb.h index 43bc8682..0090dc5c 100644 --- a/cds/container/michael_kvlist_ptb.h +++ b/cds/container/michael_kvlist_ptb.h @@ -3,7 +3,7 @@ #ifndef __CDS_CONTAINER_MICHAEL_KVLIST_PTB_H #define __CDS_CONTAINER_MICHAEL_KVLIST_PTB_H -#include +#include #include #include #include diff --git a/cds/container/michael_kvlist_rcu.h b/cds/container/michael_kvlist_rcu.h index d1aed822..aaf03ae7 100644 --- a/cds/container/michael_kvlist_rcu.h +++ b/cds/container/michael_kvlist_rcu.h @@ -4,7 +4,7 @@ #define __CDS_CONTAINER_MICHAEL_KVLIST_RCU_H #include -#include +#include #include #include #include diff --git a/cds/container/michael_list_base.h b/cds/container/michael_list_base.h deleted file mode 100644 index 117c5f83..00000000 --- a/cds/container/michael_list_base.h +++ /dev/null @@ -1,112 +0,0 @@ -//$$CDS-header$$ - -#ifndef __CDS_CONTAINER_MICHAEL_LIST_BASE_H -#define __CDS_CONTAINER_MICHAEL_LIST_BASE_H - -#include -#include -#include - -namespace cds { namespace container { - - /// MichaelList ordered list related definitions - /** @ingroup cds_nonintrusive_helper - */ - namespace michael_list { - /// Michael list default type traits - struct type_traits - { - typedef CDS_DEFAULT_ALLOCATOR allocator ; ///< allocator used to allocate new node - - /// Key comparison functor - /** - No default functor is provided. If the option is not specified, the \p less is used. - */ - typedef opt::none compare; - - /// specifies binary predicate used for key comparison. - /** - Default is \p std::less. - */ - typedef opt::none less; - - /// back-off strategy used - /** - If the option is not specified, the cds::backoff::empty is used. - */ - typedef cds::backoff::empty back_off; - - /// Item counter - /** - The type for item counting feature. - Default is no item counter (\ref atomicity::empty_item_counter) - */ - typedef atomicity::empty_item_counter item_counter; - - /// Link fields checking feature - /** - Default is \ref intrusive::opt::debug_check_link - */ - static const opt::link_check_type link_checker = opt::debug_check_link; - - /// C++ memory ordering model - /** - List of available memory ordering see opt::memory_model - */ - typedef opt::v::relaxed_ordering memory_model; - - /// RCU deadlock checking policy (only for \ref cds_intrusive_MichaelList_rcu "RCU-based MichaelList") - /** - List of available options see opt::rcu_check_deadlock - */ - typedef opt::v::rcu_throw_deadlock rcu_check_deadlock; - - //@cond - // MichaelKVList: supporting for split-ordered list - // key accessor (opt::none = internal key type is equal to user key type) - typedef opt::none key_accessor; - //@endcond - }; - - /// Metafunction converting option list to MichaelList traits - /** - This is a wrapper for cds::opt::make_options< type_traits, Options...> - - See \ref MichaelList, \ref type_traits, \ref cds::opt::make_options. - */ - template - struct make_traits { -# ifdef CDS_DOXYGEN_INVOKED - typedef implementation_defined type ; ///< Metafunction result -# else - typedef typename cds::opt::make_options< - typename cds::opt::find_type_traits< type_traits, Options... >::type - ,Options... - >::type type; -#endif - }; - - - } // namespace michael_list - - // Forward declarations - template - class MichaelList; - - template - class MichaelKVList; - - // Tag for selecting Michael's list implementation - /** - This struct is empty and it is used only as a tag for selecting MichaelList - as ordered list implementation in declaration of some classes. - - See split_list::type_traits::ordered_list as an example. - */ - struct michael_list_tag - {}; - -}} // namespace cds::container - - -#endif // #ifndef __CDS_CONTAINER_MICHAEL_LIST_BASE_H diff --git a/cds/container/michael_list_hp.h b/cds/container/michael_list_hp.h index f1ae1a8d..2ef582ac 100644 --- a/cds/container/michael_list_hp.h +++ b/cds/container/michael_list_hp.h @@ -3,7 +3,7 @@ #ifndef __CDS_CONTAINER_MICHAEL_LIST_HP_H #define __CDS_CONTAINER_MICHAEL_LIST_HP_H -#include +#include #include #include #include diff --git a/cds/container/michael_list_hrc.h b/cds/container/michael_list_hrc.h index 01cb993b..4df2ee67 100644 --- a/cds/container/michael_list_hrc.h +++ b/cds/container/michael_list_hrc.h @@ -3,7 +3,7 @@ #ifndef __CDS_CONTAINER_MICHAEL_LIST_HRC_H #define __CDS_CONTAINER_MICHAEL_LIST_HRC_H -#include +#include #include #include #include diff --git a/cds/container/michael_list_nogc.h b/cds/container/michael_list_nogc.h index 170271c0..abae2284 100644 --- a/cds/container/michael_list_nogc.h +++ b/cds/container/michael_list_nogc.h @@ -4,7 +4,7 @@ #define __CDS_CONTAINER_MICHAEL_LIST_NOGC_H #include -#include +#include #include #include diff --git a/cds/container/michael_list_ptb.h b/cds/container/michael_list_ptb.h index b1f3bfbf..546ec9af 100644 --- a/cds/container/michael_list_ptb.h +++ b/cds/container/michael_list_ptb.h @@ -3,7 +3,7 @@ #ifndef __CDS_CONTAINER_MICHAEL_LIST_PTB_H #define __CDS_CONTAINER_MICHAEL_LIST_PTB_H -#include +#include #include #include #include diff --git a/cds/container/michael_list_rcu.h b/cds/container/michael_list_rcu.h index e3b57975..e7b0c09f 100644 --- a/cds/container/michael_list_rcu.h +++ b/cds/container/michael_list_rcu.h @@ -4,7 +4,7 @@ #define __CDS_CONTAINER_MICHAEL_LIST_RCU_H #include -#include +#include #include #include #include diff --git a/projects/Win/vc12/cds.vcxproj b/projects/Win/vc12/cds.vcxproj index 1c1cacdf..2bea9fa4 100644 --- a/projects/Win/vc12/cds.vcxproj +++ b/projects/Win/vc12/cds.vcxproj @@ -663,6 +663,7 @@ + @@ -966,7 +967,6 @@ - diff --git a/projects/Win/vc12/cds.vcxproj.filters b/projects/Win/vc12/cds.vcxproj.filters index cbc8fd0f..528e827d 100644 --- a/projects/Win/vc12/cds.vcxproj.filters +++ b/projects/Win/vc12/cds.vcxproj.filters @@ -659,9 +659,6 @@ Header Files\cds\container - - Header Files\cds\container - Header Files\cds\container @@ -1283,5 +1280,8 @@ Header Files\cds\container\impl + + Header Files\cds\container\details + \ No newline at end of file diff --git a/tests/test-hdr/ordered_list/hdr_michael.h b/tests/test-hdr/ordered_list/hdr_michael.h index a0fe03e0..02465fc0 100644 --- a/tests/test-hdr/ordered_list/hdr_michael.h +++ b/tests/test-hdr/ordered_list/hdr_michael.h @@ -1,7 +1,7 @@ //$$CDS-header$$ #include "cppunit/cppunit_proxy.h" -#include +#include namespace ordlist { namespace cc = cds::container; diff --git a/tests/test-hdr/ordered_list/hdr_michael_kv.h b/tests/test-hdr/ordered_list/hdr_michael_kv.h index 9d5f3e95..263ee1ab 100644 --- a/tests/test-hdr/ordered_list/hdr_michael_kv.h +++ b/tests/test-hdr/ordered_list/hdr_michael_kv.h @@ -1,7 +1,7 @@ //$$CDS-header$$ #include "cppunit/cppunit_proxy.h" -#include +#include namespace ordlist { namespace cc = cds::container;