From fd030a874cef7be57ae4d0809839ac44348341f5 Mon Sep 17 00:00:00 2001 From: Mike Krinkin Date: Sat, 28 Mar 2015 09:36:41 +0300 Subject: [PATCH] Add sort policy to intrusive lazy list trait. Boolean sort flag indicates whether list is ordered or unordered. Default value is false, so, by default, intrusive lazy list is unordered. --- cds/intrusive/details/lazy_list_base.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cds/intrusive/details/lazy_list_base.h b/cds/intrusive/details/lazy_list_base.h index bddbd510..bc6ff520 100644 --- a/cds/intrusive/details/lazy_list_base.h +++ b/cds/intrusive/details/lazy_list_base.h @@ -215,6 +215,13 @@ namespace cds { namespace intrusive { */ typedef opt::none equal_to; + /// Specifies list ordering policy + /** + If \p sort is \p true, than list maintains items in sorted order, otherwise items are unordered. Default is \p true. + Note that if \p sort is \p false, than lookup operations scan entire list. + */ + static const bool sort = true; + /// Back-off strategy typedef cds::backoff::Default back_off; @@ -254,6 +261,7 @@ namespace cds { namespace intrusive { - \p opt::less - specifies binary predicate used for key comparison. Default is \p std::less. - \p opt::equal_to - specifies binary functor for comparing keys for equality. If \p equal_to is not specified, \p compare is used, \p compare is not specified, \p less is used. + - \p opt::sort - specifies ordering policy. Default value is \p true. - \p opt::back_off - back-off strategy used. If the option is not specified, the \p cds::backoff::Default is used. - \p opt::disposer - the functor used for dispose removed items. Default is \p opt::v::empty_disposer. Due the nature of GC schema the disposer may be called asynchronously. -- 2.34.1