X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=cds%2Fintrusive%2Fdetails%2Fmichael_set_base.h;h=aa2a3d450402f74e29e331ef8965cee0676274d1;hb=9e2654f9e05fa1ed4cbb78387363d735d385b74c;hp=5792f7f111d48c93e31fba9598db06ee19677f5f;hpb=37c90b6523be2c38f2edd610271ed0d5e2d29c1b;p=libcds.git diff --git a/cds/intrusive/details/michael_set_base.h b/cds/intrusive/details/michael_set_base.h index 5792f7f1..aa2a3d45 100644 --- a/cds/intrusive/details/michael_set_base.h +++ b/cds/intrusive/details/michael_set_base.h @@ -1,14 +1,13 @@ //$$CDS-header$$ -#ifndef __CDS_INTRUSIVE_DETAILS_MICHAEL_SET_BASE_H -#define __CDS_INTRUSIVE_DETAILS_MICHAEL_SET_BASE_H +#ifndef CDSLIB_INTRUSIVE_DETAILS_MICHAEL_SET_BASE_H +#define CDSLIB_INTRUSIVE_DETAILS_MICHAEL_SET_BASE_H #include #include #include #include -#include -#include +#include namespace cds { namespace intrusive { @@ -17,8 +16,8 @@ namespace cds { namespace intrusive { */ namespace michael_set { - /// Type traits for MichaelHashSet class - struct type_traits { + /// MichaelHashSet traits + struct traits { /// Hash function /** Hash function converts the key fields of struct \p T stored in the hash-set @@ -26,42 +25,38 @@ namespace cds { namespace intrusive { This is mandatory type and has no predefined one. */ - typedef opt::none hash; + typedef opt::none hash; /// Item counter /** - The item counting is an important part of MichaelHashSet algorithm: - the empty() member function depends on correct item counting. - Therefore, atomicity::empty_item_counter is not allowed as a type of the option. + The item counting is an important part of \p MichaelHashSet algorithm: + the \p empty() member function depends on correct item counting. + Therefore, \p atomicity::empty_item_counter is not allowed as a type of the option. - Default is atomicity::item_counter. + Default is \p atomicity::item_counter. */ - typedef atomicity::item_counter item_counter; + typedef cds::atomicity::item_counter item_counter; /// Bucket table allocator /** Allocator for bucket table. Default is \ref CDS_DEFAULT_ALLOCATOR - The allocator uses only in ctor (for allocating bucket table) - and in dtor (for destroying bucket table) + The allocator uses only in constructor for allocating bucket table + and in destructor for destroying bucket table */ typedef CDS_DEFAULT_ALLOCATOR allocator; }; /// Metafunction converting option list to traits struct /** - This is a wrapper for cds::opt::make_options< type_traits, Options...> - Available \p Options: - - opt::hash - mandatory option, specifies hash functor. - - opt::item_counter - optional, specifies item counting policy. See type_traits::item_counter + - \p opt::hash - mandatory option, specifies hash functor. + - \p opt::item_counter - optional, specifies item counting policy. See \p traits::item_counter for default type. - - opt::allocator - optional, bucket table allocator. Default is \ref CDS_DEFAULT_ALLOCATOR. - - See \ref MichaelHashSet, \ref type_traits. + - \p opt::allocator - optional, bucket table allocator. Default is \ref CDS_DEFAULT_ALLOCATOR. */ template struct make_traits { - typedef typename cds::opt::make_options< type_traits, Options...>::type type ; ///< Result of metafunction + typedef typename cds::opt::make_options< traits, Options...>::type type; ///< Metafunction result }; //@cond @@ -98,6 +93,7 @@ namespace cds { namespace intrusive { template class iterator { + friend class iterator < OrderedList, !IsConst >; protected: typedef OrderedList bucket_type; typedef typename list_iterator_selector< bucket_type, IsConst>::bucket_ptr bucket_ptr; @@ -181,7 +177,7 @@ namespace cds { namespace intrusive { } template - bool operator ==(iterator const& i ) const + bool operator ==(iterator const& i) const { return m_pCurBucket == i.m_pCurBucket && m_itList == i.m_itList; } @@ -198,10 +194,10 @@ namespace cds { namespace intrusive { //@cond // Forward declarations - template + template class MichaelHashSet; //@endcond }} // namespace cds::intrusive -#endif // #ifndef __CDS_INTRUSIVE_DETAILS_MICHAEL_SET_BASE_H +#endif // #ifndef CDSLIB_INTRUSIVE_DETAILS_MICHAEL_SET_BASE_H