X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=cds%2Fcontainer%2Fdetails%2Fmake_michael_list.h;h=794e214dc87bb4c03551fa96e506ced8b2b4eb87;hb=40e34e6d0b104b6f5aff506ad67d43fd410e52bc;hp=8d65e28baaffefb04f080a6e894fbc1396b6387b;hpb=7d15399a4d18ae2061ddb01656d85dbc940ff915;p=libcds.git diff --git a/cds/container/details/make_michael_list.h b/cds/container/details/make_michael_list.h index 8d65e28b..794e214d 100644 --- a/cds/container/details/make_michael_list.h +++ b/cds/container/details/make_michael_list.h @@ -1,7 +1,35 @@ -//$$CDS-header$$ +/* + This file is a part of libcds - Concurrent Data Structures library -#ifndef __CDS_CONTAINER_DETAILS_MAKE_MICHAEL_LIST_H -#define __CDS_CONTAINER_DETAILS_MAKE_MICHAEL_LIST_H + (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017 + + Source code repo: http://github.com/khizmax/libcds/ + Download: http://sourceforge.net/projects/libcds/files/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef CDSLIB_CONTAINER_DETAILS_MAKE_MICHAEL_LIST_H +#define CDSLIB_CONTAINER_DETAILS_MAKE_MICHAEL_LIST_H #include @@ -28,18 +56,16 @@ namespace cds { namespace container { : m_Value(v) {} -# ifdef CDS_EMPLACE_SUPPORT template node_type( Args&&... args ) : m_Value( std::forward(args)... ) {} -# endif }; - typedef Traits original_type_traits; + typedef Traits original_traits; - typedef typename original_type_traits::allocator::template rebind::other allocator_type; - typedef cds::details::Allocator< node_type, allocator_type > cxx_allocator; + typedef typename original_traits::allocator::template rebind::other allocator_type; + typedef cds::details::Allocator< node_type, allocator_type > cxx_allocator; struct node_deallocator { @@ -49,7 +75,7 @@ namespace cds { namespace container { } }; - typedef typename opt::details::make_comparator< value_type, original_type_traits >::type key_comparator; + typedef typename opt::details::make_comparator< value_type, original_traits >::type key_comparator; struct value_accessor { @@ -61,22 +87,22 @@ namespace cds { namespace container { template struct less_wrapper { - typedef cds::details::compare_wrapper< node_type, cds::opt::details::make_comparator_from_less, value_accessor > type; + typedef cds::details::compare_wrapper< node_type, cds::opt::details::make_comparator_from_less, value_accessor > type; }; - struct type_traits: public original_type_traits + struct intrusive_traits: public original_traits { - typedef intrusive::michael_list::base_hook< opt::gc > hook; - typedef node_deallocator disposer; - + typedef intrusive::michael_list::base_hook< opt::gc > hook; + typedef node_deallocator disposer; typedef cds::details::compare_wrapper< node_type, key_comparator, value_accessor > compare; + static CDS_CONSTEXPR const opt::link_check_type link_checker = cds::intrusive::michael_list::traits::link_checker; }; - typedef intrusive::MichaelList type; + typedef intrusive::MichaelList type; }; } // namespace details //@endcond }} // namespace cds::container -#endif // #ifndef __CDS_CONTAINER_DETAILS_MAKE_MICHAEL_LIST_H +#endif // #ifndef CDSLIB_CONTAINER_DETAILS_MAKE_MICHAEL_LIST_H