19 #pragma pack(push,_CRT_PACKING)
21 #pragma warning (push)
22 #pragma warning (disable: 4510 4512 4610) // disable warnings for compiler unable to generate constructor
29 template<
class _Mylist>
34 typedef std::_Flist_const_iterator<_Mylist>
_Mybase;
40 typedef typename _Mylist::const_pointer
pointer;
41 typedef typename _Mylist::const_reference
reference;
66 return ((reference)**(_Mybase *)
this);
80 while (_Mynode() !=
NULL && _Mynode()->_Is_dummy());
92 while (_Mynode() !=
NULL && _Mynode()->_Is_dummy());
98 template<
class _Mylist>
inline
104 template<
class _Mylist>
inline
111 template<
class _Mylist>
148 return ((reference)**(_Mybase *)
this);
160 ++(*(_Mybase *)
this);
162 while (_Mynode() !=
NULL && _Mynode()->_Is_dummy());
169 _Myiter _Tmp = *
this;
174 while (_Mynode() !=
NULL && _Mynode()->_Is_dummy());
180 template<
class _Mylist>
inline
186 template<
class _Mylist>
inline
197 template<
typename _Element_type,
typename _Allocator_type>
201 typedef typename _Allocator_type::template rebind<_Element_type>::other
_Allocator_type;
213 void _Init(_Split_order_key _Order_key)
231 if (_Exchange_node == _Current_node)
239 return _Exchange_node;
258 #if _ITERATOR_DEBUG_LEVEL == 0
265 typename _Allocator_type::template rebind<std::_Container_proxy>::other _Alproxy(
_M_node_allocator);
266 _Myproxy = _Alproxy.allocate(1);
267 _Alproxy.construct(_Myproxy, std::_Container_proxy());
268 _Myproxy->_Mycont =
this;
273 typename _Allocator_type::template rebind<std::_Container_proxy>::other _Alproxy(
_M_node_allocator);
275 _Alproxy.destroy(_Myproxy);
276 _Alproxy.deallocate(_Myproxy, 1);
286 template<
typename _Element_type,
typename _Allocator_type>
293 typedef typename _Allocator_type::template rebind<_Element_type>::other
_Allocator_type;
297 typedef typename _Allocator_type::pointer
pointer;
315 template<
typename _ValTy>
323 _Pnode->_Init(_Order_key);
338 _Pnode->_Init(_Order_key);
346 return ((_Nodepref)(*_Pnode)._M_next);
352 return ((reference)(*_Pnode)._M_element);
357 template <
typename _Element_type,
typename _Element_allocator_type = std::allocator<_Element_type> >
369 typedef typename _Allocator_type::pointer
pointer;
408 #if _ITERATOR_DEBUG_LEVEL == 2
409 _Orphan_ptr(*
this, 0);
417 _Pnode->_M_next =
NULL;
420 while (_Pnode !=
NULL)
433 _Full_iterator _Iterator =
_Begin();
440 _Full_const_iterator _Iterator =
_Begin();
449 const_iterator
end()
const
456 return (((
const _Mytype *)
this)->
begin());
461 return (((
const _Mytype *)
this)->
end());
525 _Full_const_iterator
_End()
const
530 static _Split_order_key
_Get_key(
const _Full_const_iterator& _Iterator)
532 return _Iterator._Mynode()->_Get_order_key();
539 _ASSERT_EXPR(_Iterator._Mynode() !=
NULL && !_Iterator._Mynode()->_Is_dummy(), L
"Invalid user node (dummy)");
540 return iterator(_Iterator._Mynode(),
this);
547 _ASSERT_EXPR(_Iterator._Mynode() !=
NULL && !_Iterator._Mynode()->_Is_dummy(), L
"Invalid user node (dummy)");
560 return iterator(_Iterator._Mynode(),
this);
568 while (_Iterator !=
_End() && _Iterator._Mynode()->_Is_dummy())
573 return iterator(_Iterator._Mynode(),
this);
581 while (_Iterator !=
_End() && _Iterator._Mynode()->_Is_dummy())
592 if (!_Delete_node->_Is_dummy())
602 _Nodeptr
_Insert(_Nodeptr _Previous, _Nodeptr _New_node, _Nodeptr _Current_node)
604 _New_node->_M_next = _Current_node;
605 return _Previous->_Atomic_set_next(_New_node, _Current_node);
609 _Pairib
_Insert(_Full_iterator _Iterator, _Full_iterator _Next, _Nodeptr
_List_node,
long * _New_count)
611 _Nodeptr _Inserted_node =
_Insert(_Iterator._Mynode(), _List_node, _Next._Mynode());
613 if (_Inserted_node == _List_node)
627 _Full_iterator
_Insert_dummy(_Full_iterator _Iterator, _Split_order_key _Order_key)
630 _Full_iterator _Where = _Iterator;
637 _Nodeptr _Dummy_node =
_Buynode(_Order_key);
641 _ASSERT_EXPR(_Iterator != _Last, L
"Invalid head list node");
645 if (_Where == _Last ||
_Get_key(_Where) > _Order_key)
650 _Nodeptr _Inserted_node =
_Insert(_Iterator._Mynode(), _Dummy_node, _Where._Mynode());
652 if (_Inserted_node == _Dummy_node)
670 else if (
_Get_key(_Where) == _Order_key)
685 void _Erase(_Full_iterator _Previous, _Full_const_iterator& _Where)
687 #if _ITERATOR_DEBUG_LEVEL == 2
688 if (_Where._Getcont() !=
this || _Where._Ptr ==
_Myhead)
692 _Nodeptr _Pnode = (_Where++)._Mynode();
693 _Orphan_ptr(*
this, _Pnode);
695 _Nodeptr _Pnode = (_Where++)._Mynode();
698 _Nodeptr _Prevnode = _Previous._Mynode();
699 _ASSERT_EXPR(_Prevnode->_M_next == _Pnode, L
"Erase must take consecutive iterators");
700 _Prevnode->_M_next = _Pnode->_M_next;
706 iterator
_Erase(_Full_iterator _Previous, const_iterator _Where)
708 _Full_const_iterator _Iterator = _Where;
709 _Erase(_Previous, _Iterator);
718 _Full_const_iterator _First = _Source_list.
_Begin();
719 _Full_const_iterator
_Last = _Source_list.
_End();
726 _Nodeptr _Previous_node =
_Myhead;
727 _Full_const_iterator _Begin_iterator = _First++;
730 for (_Full_const_iterator _Iterator = _First; _Iterator !=
_Last;)
732 _Nodeptr _Node = _Iterator._Mynode();
734 _Nodeptr _Dummy_node = _Node->_Is_dummy() ?
_Buynode(_Node->_Get_order_key()) :
_Buynode(_Node->_Get_order_key(),
_Myval(_Node));
735 _Previous_node =
_Insert(_Previous_node, _Dummy_node,
NULL);
737 _Full_const_iterator _Where = _Iterator++;
748 for (_Full_iterator _Iterator =
_Begin(); _Iterator !=
_End(); _Iterator++)
750 _Full_iterator _Next_iterator = _Iterator;
753 _ASSERT_EXPR(_Next_iterator ==
end() || _Next_iterator._Mynode()->_Get_order_key() >= _Iterator._Mynode()->_Get_order_key(), L
"!!! List order inconsistency !!!");
758 #if _ITERATOR_DEBUG_LEVEL == 2
759 void _Orphan_ptr(_Mytype& _Cont, _Nodeptr _Ptr)
const
762 const_iterator **_Pnext = (const_iterator **)_Cont._Getpfirst();
767 if ((*_Pnext)->_Ptr == (_Nodeptr)&
_Myhead || _Ptr != 0 && (*_Pnext)->_Ptr != _Ptr)
769 _Pnext = (const_iterator **)(*_Pnext)->_Getpnext();
773 (*_Pnext)->_Clrcont();
774 *_Pnext = *(const_iterator **)(*_Pnext)->_Getpnext();
789 #pragma warning (push)
std::pair< iterator, bool > _Pairib
Definition: internal_split_ordered_list.h:379
_Split_order_list_value< _Element_type, _Element_allocator_type > _Mybase
Definition: internal_split_ordered_list.h:362
Definition: internal_split_ordered_list.h:287
_Allocator_type::reference reference
Definition: internal_split_ordered_list.h:371
_Solist_const_iterator< _Mylist > _Unchecked_type
Definition: internal_split_ordered_list.h:51
_Solist_const_iterator< _Mylist > & _Rechecked(_Solist_const_iterator< _Mylist > &_Iterator, typename _Solist_const_iterator< _Mylist >::_Unchecked_type _Right)
Definition: internal_split_ordered_list.h:105
_Full_iterator _Begin()
Definition: internal_split_ordered_list.h:509
iterator _Get_iterator(const_iterator _Iterator)
Definition: internal_split_ordered_list.h:558
_Mylist::pointer pointer
Definition: internal_split_ordered_list.h:122
_Mybase::_Nodeptr _Nodeptr
Definition: internal_split_ordered_list.h:291
_CRTIMP _In_ int _Value
Definition: setjmp.h:190
static _Split_order_key _Get_key(const _Full_const_iterator &_Iterator)
Definition: internal_split_ordered_list.h:530
_Allocator_type::size_type size_type
Definition: internal_split_ordered_list.h:295
const_iterator cend() const
Definition: internal_split_ordered_list.h:459
_Solist_iterator< _Mylist > _Unchecked_type
Definition: internal_split_ordered_list.h:133
size_t _Map_key
Definition: internal_split_ordered_list.h:194
_Element_type value_type
Definition: internal_split_ordered_list.h:203
_Full_iterator _Insert_dummy(_Full_iterator _Iterator, _Split_order_key _Order_key)
Definition: internal_split_ordered_list.h:627
_Solist_const_iterator< _Mylist >::_Unchecked_type _Unchecked(_Solist_const_iterator< _Mylist > _Iterator)
Definition: internal_split_ordered_list.h:99
_Full_const_iterator _End() const
Definition: internal_split_ordered_list.h:525
_Allocator_type::reference reference
Definition: internal_split_ordered_list.h:299
_Unchecked_type _Unchecked() const
Definition: internal_split_ordered_list.h:59
Definition: internal_split_ordered_list.h:112
_Allocator_type allocator_type
Definition: internal_split_ordered_list.h:366
_Full_const_iterator _Begin() const
Definition: internal_split_ordered_list.h:515
_Split_ordered_list(_Allocator_type _Allocator=allocator_type())
Definition: internal_split_ordered_list.h:381
allocator_type get_allocator() const
Definition: internal_split_ordered_list.h:401
_Solist_const_iterator(_Nodeptr _Pnode, const _Mylist *_Plist)
Definition: internal_split_ordered_list.h:47
_Nodeptr & _Nodepref
Definition: internal_split_ordered_list.h:207
_Mybase::_Nodepref _Nodepref
Definition: internal_split_ordered_list.h:292
_Split_ordered_list< _Element_type, _Element_allocator_type > _Mytype
Definition: internal_split_ordered_list.h:361
_Mylist::difference_type difference_type
Definition: internal_split_ordered_list.h:121
std::_Flist_iterator< _Mybase > _Full_iterator
Definition: internal_split_ordered_list.h:378
_Allocator_type::value_type value_type
Definition: internal_split_ordered_list.h:373
_Mylist::_Nodeptr _Nodeptr
Definition: internal_split_ordered_list.h:119
_Solist_const_iterator< _Mylist > _Myiter
Definition: internal_split_ordered_list.h:33
const_iterator _Get_first_real_iterator(_Full_const_iterator _Iterator) const
Definition: internal_split_ordered_list.h:578
pointer operator->() const
Definition: internal_split_ordered_list.h:69
_Split_order_key _M_order_key
Definition: internal_split_ordered_list.h:255
pointer operator->() const
Definition: internal_split_ordered_list.h:151
_Mylist::reference reference
Definition: internal_split_ordered_list.h:123
The Concurrency namespace provides classes and functions that provide access to the Concurrency Runti...
Definition: agents.h:42
_Full_iterator _End()
Definition: internal_split_ordered_list.h:520
_Allocator_type::size_type size_type
Definition: internal_split_ordered_list.h:202
_Allocator_type::const_pointer const_pointer
Definition: internal_split_ordered_list.h:298
_Solist_iterator()
Definition: internal_split_ordered_list.h:125
#define NULL
Definition: crtdbg.h:30
std::forward_iterator_tag iterator_category
Definition: internal_split_ordered_list.h:35
std::_Flist_const_iterator< _Mylist > _Mybase
Definition: internal_split_ordered_list.h:34
_Mylist::_Nodeptr _Nodeptr
Definition: internal_split_ordered_list.h:37
_Container_base0 _Container_base
Definition: xutility:245
bool empty() const
Definition: internal_split_ordered_list.h:465
volatile long _M_element_count
Definition: internal_split_ordered_list.h:781
_Allocator_type::const_reference const_reference
Definition: internal_split_ordered_list.h:372
void _Erase(_Nodeptr _Delete_node)
Definition: internal_split_ordered_list.h:590
_Allocator_type::template rebind< _Element_type >::other _Allocator_type
Definition: internal_split_ordered_list.h:293
_Allocator_type::size_type size_type
Definition: internal_split_ordered_list.h:367
const_iterator end() const
Definition: internal_split_ordered_list.h:449
_Split_order_key _Get_order_key() const
Definition: internal_split_ordered_list.h:220
_Mylist::const_pointer pointer
Definition: internal_split_ordered_list.h:40
reference operator*() const
Definition: internal_split_ordered_list.h:64
#define _ASSERT_EXPR(expr, expr_str)
Definition: crtdbg.h:220
iterator end()
Definition: internal_split_ordered_list.h:444
_Unchecked_type _Unchecked() const
Definition: internal_split_ordered_list.h:141
Definition: internal_split_ordered_list.h:30
void _Move_all(_Mytype &_Source_list)
Definition: internal_split_ordered_list.h:716
#define _LOCK_DEBUG
Definition: yvals.h:615
_Nodeptr _Insert(_Nodeptr _Previous, _Nodeptr _New_node, _Nodeptr _Current_node)
Definition: internal_split_ordered_list.h:602
size_type size() const
Definition: internal_split_ordered_list.h:471
_Myiter & _Rechecked(_Unchecked_type _Right)
Definition: internal_split_ordered_list.h:135
std::forward_iterator_tag iterator_category
Definition: internal_split_ordered_list.h:117
Definition: internal_split_ordered_list.h:198
_Full_iterator _Get_iterator(_Full_const_iterator _Iterator)
Definition: internal_split_ordered_list.h:552
~_Split_ordered_list()
Definition: internal_split_ordered_list.h:385
_Allocator_type::difference_type difference_type
Definition: internal_split_ordered_list.h:296
_Mylist::value_type value_type
Definition: internal_split_ordered_list.h:38
_Nodeptr _Myhead
Definition: internal_split_ordered_list.h:281
void _Init(_Split_order_key _Order_key)
Definition: internal_split_ordered_list.h:213
_Mylist::const_reference reference
Definition: internal_split_ordered_list.h:41
iterator _Get_first_real_iterator(_Full_iterator _Iterator)
Definition: internal_split_ordered_list.h:565
size_type max_size() const
Definition: internal_split_ordered_list.h:477
_Nodeptr _Buynode(_Split_order_key _Order_key)
Definition: internal_split_ordered_list.h:335
_Myiter operator++(int)
Definition: internal_split_ordered_list.h:85
void * _InterlockedCompareExchangePointer(void *volatile *, void *, void *)
_Nodeptr _Buynode(_Split_order_key _Order_key, _ValTy &&_Value)
Definition: internal_split_ordered_list.h:316
_Mylist::difference_type difference_type
Definition: internal_split_ordered_list.h:39
void swap(_Mytype &_Right)
Definition: internal_split_ordered_list.h:483
_Solist_iterator< _Mybase > iterator
Definition: internal_split_ordered_list.h:376
_Allocator_type::value_type value_type
Definition: internal_split_ordered_list.h:301
_Node * _Nodeptr
Definition: internal_split_ordered_list.h:205
_Allocator_type::difference_type difference_type
Definition: internal_split_ordered_list.h:368
_Split_order_list_value(_Allocator_type _Allocator=_Allocator_type())
Definition: internal_split_ordered_list.h:303
_Allocator_type::const_reference const_reference
Definition: internal_split_ordered_list.h:300
static reference _Myval(_Nodeptr _Pnode)
Definition: internal_split_ordered_list.h:350
_Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:91
_Myiter & operator++()
Definition: internal_split_ordered_list.h:74
_Nodeptr _Atomic_set_next(_Nodeptr _New_node, _Nodeptr _Current_node)
Definition: internal_split_ordered_list.h:226
_Mybase::_Allocator_type _Allocator_type
Definition: internal_split_ordered_list.h:363
_Map_key _Split_order_key
Definition: internal_split_ordered_list.h:195
_Allocator_type::pointer pointer
Definition: internal_split_ordered_list.h:297
iterator _Erase(_Full_iterator _Previous, const_iterator _Where)
Definition: internal_split_ordered_list.h:706
_Split_order_list_node< _Element_type, _Allocator_type > _Mybase
Definition: internal_split_ordered_list.h:290
void swap(array< _Ty, _Size > &_Left, array< _Ty, _Size > &_Right) _NOEXCEPT_OP(_NOEXCEPT_OP(_Left.swap(_Right)))
Definition: array:429
_Myiter & _Rechecked(_Unchecked_type _Right)
Definition: internal_split_ordered_list.h:53
reference operator*() const
Definition: internal_split_ordered_list.h:146
_Allocator_type::template rebind< _Node >::other _M_node_allocator
Definition: internal_split_ordered_list.h:282
_Myiter operator++(int)
Definition: internal_split_ordered_list.h:167
const_iterator begin() const
Definition: internal_split_ordered_list.h:438
iterator begin()
Definition: internal_split_ordered_list.h:431
value_type _M_element
Definition: internal_split_ordered_list.h:254
_Allocator_type _M_value_allocator
Definition: internal_split_ordered_list.h:283
~_Split_order_list_value()
Definition: internal_split_ordered_list.h:310
void _Erase(_Full_iterator _Previous, _Full_const_iterator &_Where)
Definition: internal_split_ordered_list.h:685
void _Check_range()
Definition: internal_split_ordered_list.h:745
_Solist_const_iterator()
Definition: internal_split_ordered_list.h:43
_Split_order_list_node(_Allocator_type _Allocator)
Definition: internal_split_ordered_list.h:259
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
_Mybase::_Nodeptr _Nodeptr
Definition: internal_split_ordered_list.h:364
static _Nodepref _Nextnode(_Nodeptr _Pnode)
Definition: internal_split_ordered_list.h:344
iterator _Get_iterator(_Full_iterator _Iterator)
Definition: internal_split_ordered_list.h:537
std::_Flist_const_iterator< _Mybase > _Full_const_iterator
Definition: internal_split_ordered_list.h:377
_Myiter & operator++()
Definition: internal_split_ordered_list.h:156
long __cdecl _InterlockedIncrement(long volatile *)
_Solist_iterator< _Mylist > _Myiter
Definition: internal_split_ordered_list.h:115
_Solist_const_iterator< _Mybase > const_iterator
Definition: internal_split_ordered_list.h:375
const_iterator cbegin() const
Definition: internal_split_ordered_list.h:454
Definition: internal_split_ordered_list.h:210
_Pairib _Insert(_Full_iterator _Iterator, _Full_iterator _Next, _Nodeptr _List_node, long *_New_count)
Definition: internal_split_ordered_list.h:609
_Allocator_type::pointer pointer
Definition: internal_split_ordered_list.h:369
Definition: internal_split_ordered_list.h:358
_Nodeptr _M_next
Definition: internal_split_ordered_list.h:253
void clear()
Definition: internal_split_ordered_list.h:406
_Solist_const_iterator< _Mylist > _Mybase
Definition: internal_split_ordered_list.h:116
_FwdIt _Last
Definition: algorithm:1936
const_iterator _Get_iterator(_Full_const_iterator _Iterator) const
Definition: internal_split_ordered_list.h:545
_Allocator_type::const_pointer const_pointer
Definition: internal_split_ordered_list.h:370
const _Ty & _Right
Definition: algorithm:4087
_Allocator_type::template rebind< _Element_type >::other _Allocator_type
Definition: internal_split_ordered_list.h:201
_Solist_iterator(_Nodeptr _Pnode, const _Mylist *_Plist)
Definition: internal_split_ordered_list.h:129
bool _Is_dummy() const
Definition: internal_split_ordered_list.h:245
_Mylist::value_type value_type
Definition: internal_split_ordered_list.h:120