From: khizmax Date: Sat, 27 Sep 2014 19:28:15 +0000 (+0400) Subject: Move split_list_base.h from cds/container to cds/container/details X-Git-Tag: v2.0.0~255 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=15cb03072bf128087abd00b4e35bbef970f93d37;p=libcds.git Move split_list_base.h from cds/container to cds/container/details --- diff --git a/cds/container/details/make_split_list_set.h b/cds/container/details/make_split_list_set.h index 396e2bdd..630f821f 100644 --- a/cds/container/details/make_split_list_set.h +++ b/cds/container/details/make_split_list_set.h @@ -3,7 +3,7 @@ #ifndef __CDS_CONTAINER_DETAILS_MAKE_SPLIT_LIST_SET_H #define __CDS_CONTAINER_DETAILS_MAKE_SPLIT_LIST_SET_H -#include +#include #include #include diff --git a/cds/container/details/split_list_base.h b/cds/container/details/split_list_base.h new file mode 100644 index 00000000..81db6855 --- /dev/null +++ b/cds/container/details/split_list_base.h @@ -0,0 +1,176 @@ +//$$CDS-header$$ + +#ifndef __CDS_CONTAINER_DETAILS_SPLIT_LIST_BASE_H +#define __CDS_CONTAINER_DETAILS_SPLIT_LIST_BASE_H + +#include + +namespace cds { namespace container { + + // forward declaration + struct michael_list_tag; + + /// SplitListSet related definitions + /** @ingroup cds_nonintrusive_helper + */ + namespace split_list { + using intrusive::split_list::dynamic_bucket_table; + + //@cond + namespace details { + + template + struct wrap_map_traits_helper { + typedef Opt key_accessor; + }; + + template + struct wrap_map_traits_helper + { + struct key_accessor + { + typedef Key key_type; + key_type const & operator()( std::pair const & val ) const + { + return val.first; + } + }; + }; + + template + struct wrap_map_traits: public Traits + { + typedef typename wrap_map_traits_helper::key_accessor key_accessor; + }; + + template + struct wrap_set_traits_helper { + typedef Opt key_accessor; + }; + + template + struct wrap_set_traits_helper + { + struct key_accessor + { + typedef Value key_type; + key_type const& operator()( Value const& val ) const + { + return val; + } + }; + }; + + template + struct wrap_set_traits: public Traits + { + typedef typename wrap_set_traits_helper::key_accessor key_accessor; + }; + } // namespace details + //@endcond + + + /// Type traits for SplitListSet class + /** + Note, the SplitListSet type traits is based on intrusive::split_list::type_traits. + Any member declared in intrusive::split_list::type_traits is also applied to + container::split_list::type_traits. + */ + struct type_traits: public intrusive::split_list::type_traits + { + // Ordered list implementation + /** + This option selects appropriate ordered-list implementation for split-list. + It may be \ref michael_list_tag or \ref lazy_list_tag. + */ + typedef michael_list_tag ordered_list; + + // Ordered list traits + /** + With this option you can specify type traits for selected ordered list class. + If this option is opt::none, the ordered list traits is combined with default + ordered list traits and split-list traits. + + For \p michael_list_tag, the default traits is \ref container::michael_list::type_traits. + + For \p lazy_list_tag, the default traits is \ref container::lazy_list::type_traits. + */ + typedef opt::none ordered_list_traits; + + //@cond + typedef opt::none key_accessor; + //@endcond + }; + + /// Option to select ordered list class for split-list + /** + This option selects appropriate ordered list class for containers based on split-list. + Template parameter \p Type may be \ref michael_list_tag or \ref lazy_list_tag. + */ + template + struct ordered_list + { + //@cond + template struct pack: public Base + { + typedef Type ordered_list; + }; + //@endcond + }; + + /// Option to specify ordered list type traits + /** + The \p Type template parameter specifies ordered list type traits. + It depends on type of ordered list selected. + */ + template + struct ordered_list_traits + { + //@cond + template struct pack: public Base + { + typedef Type ordered_list_traits; + }; + //@endcond + }; + + /// Metafunction converting option list to traits struct + /** + Available \p Options: + - split_list::ordered_list - a tag for ordered list implementation. + See split_list::ordered_list for possible values. + - split_list::ordered_list_traits - type traits for ordered list implementation. + For MichaelList use container::michael_list::type_traits, + for LazyList use container::lazy_list::type_traits. + - plus any option from intrusive::split_list::make_traits + */ + template + struct make_traits { + typedef typename cds::opt::make_options< type_traits, Options...>::type type ; ///< Result of metafunction + }; + } // namespace split_list + + //@cond + // Forward declarations + template + class SplitListSet; + + template + class SplitListMap; + //@endcond + + //@cond + // Forward declaration + namespace details { + template + struct make_split_list_set; + + template + struct make_split_list_map; + } + //@endcond + +}} // namespace cds::container + + +#endif // #ifndef __CDS_CONTAINER_DETAILS_SPLIT_LIST_BASE_H diff --git a/cds/container/split_list_base.h b/cds/container/split_list_base.h deleted file mode 100644 index 3c0584cb..00000000 --- a/cds/container/split_list_base.h +++ /dev/null @@ -1,176 +0,0 @@ -//$$CDS-header$$ - -#ifndef __CDS_CONTAINER_SPLIT_LIST_BASE_H -#define __CDS_CONTAINER_SPLIT_LIST_BASE_H - -#include - -namespace cds { namespace container { - - // forward declaration - struct michael_list_tag; - - /// SplitListSet related definitions - /** @ingroup cds_nonintrusive_helper - */ - namespace split_list { - using intrusive::split_list::dynamic_bucket_table; - - //@cond - namespace details { - - template - struct wrap_map_traits_helper { - typedef Opt key_accessor; - }; - - template - struct wrap_map_traits_helper - { - struct key_accessor - { - typedef Key key_type; - key_type const & operator()( std::pair const & val ) const - { - return val.first; - } - }; - }; - - template - struct wrap_map_traits: public Traits - { - typedef typename wrap_map_traits_helper::key_accessor key_accessor; - }; - - template - struct wrap_set_traits_helper { - typedef Opt key_accessor; - }; - - template - struct wrap_set_traits_helper - { - struct key_accessor - { - typedef Value key_type; - key_type const& operator()( Value const& val ) const - { - return val; - } - }; - }; - - template - struct wrap_set_traits: public Traits - { - typedef typename wrap_set_traits_helper::key_accessor key_accessor; - }; - } // namespace details - //@endcond - - - /// Type traits for SplitListSet class - /** - Note, the SplitListSet type traits is based on intrusive::split_list::type_traits. - Any member declared in intrusive::split_list::type_traits is also applied to - container::split_list::type_traits. - */ - struct type_traits: public intrusive::split_list::type_traits - { - // Ordered list implementation - /** - This option selects appropriate ordered-list implementation for split-list. - It may be \ref michael_list_tag or \ref lazy_list_tag. - */ - typedef michael_list_tag ordered_list; - - // Ordered list traits - /** - With this option you can specify type traits for selected ordered list class. - If this option is opt::none, the ordered list traits is combined with default - ordered list traits and split-list traits. - - For \p michael_list_tag, the default traits is \ref container::michael_list::type_traits. - - For \p lazy_list_tag, the default traits is \ref container::lazy_list::type_traits. - */ - typedef opt::none ordered_list_traits; - - //@cond - typedef opt::none key_accessor; - //@endcond - }; - - /// Option to select ordered list class for split-list - /** - This option selects appropriate ordered list class for containers based on split-list. - Template parameter \p Type may be \ref michael_list_tag or \ref lazy_list_tag. - */ - template - struct ordered_list - { - //@cond - template struct pack: public Base - { - typedef Type ordered_list; - }; - //@endcond - }; - - /// Option to specify ordered list type traits - /** - The \p Type template parameter specifies ordered list type traits. - It depends on type of ordered list selected. - */ - template - struct ordered_list_traits - { - //@cond - template struct pack: public Base - { - typedef Type ordered_list_traits; - }; - //@endcond - }; - - /// Metafunction converting option list to traits struct - /** - Available \p Options: - - split_list::ordered_list - a tag for ordered list implementation. - See split_list::ordered_list for possible values. - - split_list::ordered_list_traits - type traits for ordered list implementation. - For MichaelList use container::michael_list::type_traits, - for LazyList use container::lazy_list::type_traits. - - plus any option from intrusive::split_list::make_traits - */ - template - struct make_traits { - typedef typename cds::opt::make_options< type_traits, Options...>::type type ; ///< Result of metafunction - }; - } // namespace split_list - - //@cond - // Forward declarations - template - class SplitListSet; - - template - class SplitListMap; - //@endcond - - //@cond - // Forward declaration - namespace details { - template - struct make_split_list_set; - - template - struct make_split_list_map; - } - //@endcond - -}} // namespace cds::container - - -#endif // #ifndef __CDS_CONTAINER_SPLIT_LIST_BASE_H diff --git a/cds/container/split_list_set_nogc.h b/cds/container/split_list_set_nogc.h index 833e728f..7a133a5f 100644 --- a/cds/container/split_list_set_nogc.h +++ b/cds/container/split_list_set_nogc.h @@ -4,7 +4,7 @@ #define __CDS_CONTAINER_SPLIT_LIST_SET_NOGC_H #include -#include +#include #include #include diff --git a/projects/Win/vc12/cds.vcxproj b/projects/Win/vc12/cds.vcxproj index 6aac01b9..49031a1a 100644 --- a/projects/Win/vc12/cds.vcxproj +++ b/projects/Win/vc12/cds.vcxproj @@ -667,6 +667,7 @@ + @@ -983,7 +984,6 @@ - diff --git a/projects/Win/vc12/cds.vcxproj.filters b/projects/Win/vc12/cds.vcxproj.filters index d63799f3..37c948f5 100644 --- a/projects/Win/vc12/cds.vcxproj.filters +++ b/projects/Win/vc12/cds.vcxproj.filters @@ -698,9 +698,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