From: khizmax Date: Sat, 27 Sep 2014 18:44:49 +0000 (+0400) Subject: Move lazy_list_base.h from cds/container to cds/container/details X-Git-Tag: v2.0.0~266 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4b186f065d9d1395ab581b5b03d3b8ec7635828e;p=libcds.git Move lazy_list_base.h from cds/container to cds/container/details --- diff --git a/cds/container/details/lazy_list_base.h b/cds/container/details/lazy_list_base.h new file mode 100644 index 00000000..9dbe0e2e --- /dev/null +++ b/cds/container/details/lazy_list_base.h @@ -0,0 +1,127 @@ +//$$CDS-header$$ + +#ifndef __CDS_CONTAINER_DETAILS_LAZY_LIST_BASE_H +#define __CDS_CONTAINER_DETAILS_LAZY_LIST_BASE_H + +#include +#include +#include + +namespace cds { namespace container { + + /// LazyList ordered list related definitions + /** @ingroup cds_nonintrusive_helper + */ + namespace lazy_list { + /// Lazy list default type traits + /** + Either \p compare or \p less or both must be specified. + */ + struct type_traits + { + /// allocator used to allocate new node + typedef CDS_DEFAULT_ALLOCATOR allocator; + + /// 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; + + /// Lock type used to lock modifying items + /** + Default is cds::lock::Spin + */ + typedef cds::lock::Spin lock_type; + + /// back-off strategy used + /** + If the option is not specified, the cds::backoff::Default is used. + */ + typedef cds::backoff::Default 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_LazyList_rcu "RCU-based LazyList") + /** + List of available options see opt::rcu_check_deadlock + */ + typedef opt::v::rcu_throw_deadlock rcu_check_deadlock; + + //@cond + // LazyKVList: supporting for split-ordered list + // key accessor (opt::none = internal key type is equal to user key type) + typedef opt::none key_accessor; + + // for internal use only!!! + typedef opt::none boundary_node_type; + + //@endcond + }; + + /// Metafunction converting option list to traits for LazyList + /** + This is a wrapper for cds::opt::make_options< type_traits, Options...> + + See \ref LazyList, \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 lazy_list + + // Forward declarations + template + class LazyList; + + template + class LazyKVList; + + // Tag for selecting lazy list implementation + /** + This struct is empty and it is used only as a tag for selecting LazyList + as ordered list implementation in declaration of some classes. + + See split_list::type_traits::ordered_list as an example. + */ + struct lazy_list_tag + {}; + + +}} // namespace cds::container + + +#endif // #ifndef __CDS_CONTAINER_DETAILS_LAZY_LIST_BASE_H diff --git a/cds/container/lazy_kvlist_hp.h b/cds/container/lazy_kvlist_hp.h index d29b3c9d..83ffff44 100644 --- a/cds/container/lazy_kvlist_hp.h +++ b/cds/container/lazy_kvlist_hp.h @@ -3,7 +3,7 @@ #ifndef __CDS_CONTAINER_LAZY_KVLIST_HP_H #define __CDS_CONTAINER_LAZY_KVLIST_HP_H -#include +#include #include #include #include diff --git a/cds/container/lazy_kvlist_hrc.h b/cds/container/lazy_kvlist_hrc.h index d7a49a51..0e6a8268 100644 --- a/cds/container/lazy_kvlist_hrc.h +++ b/cds/container/lazy_kvlist_hrc.h @@ -3,7 +3,7 @@ #ifndef __CDS_CONTAINER_LAZY_KVLIST_HRC_H #define __CDS_CONTAINER_LAZY_KVLIST_HRC_H -#include +#include #include #include #include diff --git a/cds/container/lazy_kvlist_nogc.h b/cds/container/lazy_kvlist_nogc.h index 03e2b392..f05fc444 100644 --- a/cds/container/lazy_kvlist_nogc.h +++ b/cds/container/lazy_kvlist_nogc.h @@ -4,7 +4,7 @@ #define __CDS_CONTAINER_LAZY_KVLIST_NOGC_H #include -#include +#include #include #include #include diff --git a/cds/container/lazy_kvlist_ptb.h b/cds/container/lazy_kvlist_ptb.h index 6fe26378..8b448f38 100644 --- a/cds/container/lazy_kvlist_ptb.h +++ b/cds/container/lazy_kvlist_ptb.h @@ -3,7 +3,7 @@ #ifndef __CDS_CONTAINER_LAZY_KVLIST_PTB_H #define __CDS_CONTAINER_LAZY_KVLIST_PTB_H -#include +#include #include #include #include diff --git a/cds/container/lazy_kvlist_rcu.h b/cds/container/lazy_kvlist_rcu.h index e854631d..10d47ae4 100644 --- a/cds/container/lazy_kvlist_rcu.h +++ b/cds/container/lazy_kvlist_rcu.h @@ -4,7 +4,7 @@ #define __CDS_CONTAINER_LAZY_KVLIST_RCU_H #include -#include +#include #include #include #include diff --git a/cds/container/lazy_list_base.h b/cds/container/lazy_list_base.h deleted file mode 100644 index 2f99b425..00000000 --- a/cds/container/lazy_list_base.h +++ /dev/null @@ -1,127 +0,0 @@ -//$$CDS-header$$ - -#ifndef __CDS_CONTAINER_LAZY_LIST_BASE_H -#define __CDS_CONTAINER_LAZY_LIST_BASE_H - -#include -#include -#include - -namespace cds { namespace container { - - /// LazyList ordered list related definitions - /** @ingroup cds_nonintrusive_helper - */ - namespace lazy_list { - /// Lazy list default type traits - /** - Either \p compare or \p less or both must be specified. - */ - struct type_traits - { - /// allocator used to allocate new node - typedef CDS_DEFAULT_ALLOCATOR allocator; - - /// 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; - - /// Lock type used to lock modifying items - /** - Default is cds::lock::Spin - */ - typedef cds::lock::Spin lock_type; - - /// back-off strategy used - /** - If the option is not specified, the cds::backoff::Default is used. - */ - typedef cds::backoff::Default 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_LazyList_rcu "RCU-based LazyList") - /** - List of available options see opt::rcu_check_deadlock - */ - typedef opt::v::rcu_throw_deadlock rcu_check_deadlock; - - //@cond - // LazyKVList: supporting for split-ordered list - // key accessor (opt::none = internal key type is equal to user key type) - typedef opt::none key_accessor; - - // for internal use only!!! - typedef opt::none boundary_node_type; - - //@endcond - }; - - /// Metafunction converting option list to traits for LazyList - /** - This is a wrapper for cds::opt::make_options< type_traits, Options...> - - See \ref LazyList, \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 lazy_list - - // Forward declarations - template - class LazyList; - - template - class LazyKVList; - - // Tag for selecting lazy list implementation - /** - This struct is empty and it is used only as a tag for selecting LazyList - as ordered list implementation in declaration of some classes. - - See split_list::type_traits::ordered_list as an example. - */ - struct lazy_list_tag - {}; - - -}} // namespace cds::container - - -#endif // #ifndef __CDS_CONTAINER_LAZY_LIST_BASE_H diff --git a/cds/container/lazy_list_hp.h b/cds/container/lazy_list_hp.h index 66816a72..cbb73cdc 100644 --- a/cds/container/lazy_list_hp.h +++ b/cds/container/lazy_list_hp.h @@ -3,7 +3,7 @@ #ifndef __CDS_CONTAINER_LAZY_LIST_HP_H #define __CDS_CONTAINER_LAZY_LIST_HP_H -#include +#include #include #include #include diff --git a/cds/container/lazy_list_hrc.h b/cds/container/lazy_list_hrc.h index d63bbd15..d466fd19 100644 --- a/cds/container/lazy_list_hrc.h +++ b/cds/container/lazy_list_hrc.h @@ -3,7 +3,7 @@ #ifndef __CDS_CONTAINER_LAZY_LIST_HRC_H #define __CDS_CONTAINER_LAZY_LIST_HRC_H -#include +#include #include #include #include diff --git a/cds/container/lazy_list_nogc.h b/cds/container/lazy_list_nogc.h index 3a5fbd72..96394f17 100644 --- a/cds/container/lazy_list_nogc.h +++ b/cds/container/lazy_list_nogc.h @@ -4,7 +4,7 @@ #define __CDS_CONTAINER_LAZY_LIST_NOGC_H #include -#include +#include #include #include diff --git a/cds/container/lazy_list_ptb.h b/cds/container/lazy_list_ptb.h index 4fed1142..be535fe2 100644 --- a/cds/container/lazy_list_ptb.h +++ b/cds/container/lazy_list_ptb.h @@ -3,7 +3,7 @@ #ifndef __CDS_CONTAINER_LAZY_LIST_PTB_H #define __CDS_CONTAINER_LAZY_LIST_PTB_H -#include +#include #include #include #include diff --git a/cds/container/lazy_list_rcu.h b/cds/container/lazy_list_rcu.h index 59fa065b..745273f0 100644 --- a/cds/container/lazy_list_rcu.h +++ b/cds/container/lazy_list_rcu.h @@ -4,7 +4,7 @@ #define __CDS_CONTAINER_LAZY_LIST_RCU_H #include -#include +#include #include #include #include diff --git a/projects/Win/vc12/cds.vcxproj b/projects/Win/vc12/cds.vcxproj index 10a917ec..6379e67d 100644 --- a/projects/Win/vc12/cds.vcxproj +++ b/projects/Win/vc12/cds.vcxproj @@ -659,6 +659,7 @@ + @@ -955,7 +956,6 @@ - diff --git a/projects/Win/vc12/cds.vcxproj.filters b/projects/Win/vc12/cds.vcxproj.filters index 27a9dcca..d53ecdbd 100644 --- a/projects/Win/vc12/cds.vcxproj.filters +++ b/projects/Win/vc12/cds.vcxproj.filters @@ -635,9 +635,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_lazy.h b/tests/test-hdr/ordered_list/hdr_lazy.h index 2ef4073f..f7b9eb52 100644 --- a/tests/test-hdr/ordered_list/hdr_lazy.h +++ b/tests/test-hdr/ordered_list/hdr_lazy.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_lazy_kv.h b/tests/test-hdr/ordered_list/hdr_lazy_kv.h index 34804647..e800f497 100644 --- a/tests/test-hdr/ordered_list/hdr_lazy_kv.h +++ b/tests/test-hdr/ordered_list/hdr_lazy_kv.h @@ -1,7 +1,7 @@ //$$CDS-header$$ #include "cppunit/cppunit_proxy.h" -#include +#include namespace ordlist { namespace cc = cds::container;