00001
00013 #include <algorithm>
00014 #include <functional>
00015 #include <utility>
00016 #include <iterator>
00017 #include "CSSkipListTools.h"
00018
00019
00020
00021 template<unsigned int X, class container_type>
00022 class XIterator0;
00023
00024 template<unsigned int X, class container_type>
00025 class XIterator1;
00026
00027 template<unsigned int X, class container_type>
00028 class YIterator0;
00029
00030 template<unsigned int X, class container_type>
00031 class YIterator1;
00032
00033
00034 template<unsigned int X, class container_type, class Pr>
00035 void sort(CS::XIterator0<X,container_type> first, CS::XIterator0<X,container_type> last, const Pr pred);
00036
00037 template<unsigned int X, class container_type, class Pr>
00038 void stable_sort(CS::XIterator0<X,container_type> first, CS::XIterator0<X,container_type> last, const Pr pred);
00039
00040 template<unsigned int X, class container_type>
00041 void sort(CS::XIterator0<X,container_type> first, CS::XIterator0<X,container_type> last);
00042
00043 template<unsigned int X, class container_type>
00044 void stable_sort(CS::XIterator0<X,container_type> first, CS::XIterator0<X,container_type> last);
00045
00047
00067 template <class T, class NT>
00068 class XList
00069 {
00070 public:
00072
00078 virtual void insert(NT *node)=0;
00079
00081
00085 virtual void insert(NT *ref, NT *node)=0;
00086
00088
00093 virtual void erase(NT *node)=0;
00094
00095
00097
00104 virtual void setData(void *data)=0;
00105
00107 virtual void clear()=0;
00108
00109
00110 };
00111
00113
00119 template<class size_type, class node_type>
00120 class XTmpContainer
00121 {
00122 private:
00123 XTmpContainer() {}
00124 public:
00125 unsigned int maxLevel;
00126 unsigned int level;
00127 node_type *head;
00128 node_type *tail;
00129 double probability;
00130 size_type items;
00131
00133
00137 node_type* Alloc(unsigned int level) {}
00138
00140
00143 void Free(node_type *item) {}
00144
00146
00150 XTmpContainer(double probability, unsigned int maxLevel) {}
00151
00153
00156 ~XTmpContainer() {}
00157
00159
00162 size_type size() const{}
00163
00165
00168 bool empty() const{}
00169
00170 };
00171
00173
00191 template<class size_type, class difference_type, class node_type, class value_type, unsigned int N, unsigned int S, class R>
00192 class XData
00193 {
00194 public:
00195 R rng;
00196
00197 unsigned int maxLevel;
00198 unsigned int level;
00199 node_type *head;
00200 node_type *tail;
00201 double probability;
00202 size_type items;
00203
00204 mutable size_type scan_index[N];
00205 mutable std::pair<size_type,node_type*> *update[N];
00206
00208 XList<value_type,node_type>* Containers[N];
00209
00211 typedef XTmpContainer<size_type, node_type> tmp_container_type;
00212 tmp_container_type *tmp_container;
00213
00215 void InitData() {}
00216
00217 unsigned int getListCount() const { return N; }
00218 unsigned int getIndexCount() const { return S; }
00219
00221
00226 node_type* Alloc(unsigned int level, const value_type &obj) {}
00227
00229
00233 node_type* Alloc(unsigned int level) {}
00234
00236
00239 void Free(node_type *item) {}
00240
00242
00245 unsigned int GenerateRandomLevel() const {}
00246
00248 void adjust_levels() {}
00249
00251
00258 void scan(node_type *nodex, unsigned int x) const {}
00259
00261
00264 void erase(node_type *node) {}
00265
00267 XData() {}
00268
00270
00278 ~XData() {}
00279 };
00280
00282
00293 template <class T, unsigned int N=1, unsigned int S=0>
00294 class XBidiNode
00295 {
00296 public:
00298 typedef size_t size_type;
00300 struct Pointers
00301 {
00302 size_type skip[S];
00303 XBidiNode<T,N,S> *forward[N];
00304 XBidiNode<T,N,S> *backward[N];
00305 };
00306 typedef Pointers ptr_type;
00307
00308 T object;
00309 unsigned int level;
00310 ptr_type pointers[1];
00311
00313
00318 XBidiNode<T,N,S>*& forward(unsigned int ptr_type, unsigned int level) {return pointers[level].forward[ptr_type];}
00319
00321
00326 XBidiNode<T,N,S>*& backward(unsigned int ptr_type, unsigned int level) {return pointers[level].backward[ptr_type];}
00327
00329
00336 size_type& skip(unsigned int ptr_type, unsigned int level) {return pointers[level].skip[ptr_type];}
00337
00339
00344 XBidiNode<T,N,S>* forward(unsigned int ptr_type, unsigned int level) const {return pointers[level].forward[ptr_type];}
00345
00347
00352 XBidiNode<T,N,S>* backward(unsigned int ptr_type, unsigned int level) const {return pointers[level].backward[ptr_type];}
00353
00355
00362 size_type skip(unsigned int ptr_type, unsigned int level) const {return pointers[level].skip[ptr_type];}
00363
00365
00369 XBidiNode(unsigned int level, const T obj) {}
00370
00372
00377 XBidiNode(unsigned int level) {}
00378
00379 unsigned int getListCount() const { return N; }
00380 unsigned int getIndexCount() const { return S; }
00381 };
00382
00384
00396 template <class T, unsigned int N, unsigned int S=0, class R = RNG>
00397 class XBidiCompositeSkipList
00398 {
00399 public:
00401 typedef XBidiCompositeSkipList<T,N,S,R> container_type;
00403 typedef size_t size_type;
00405
00408 typedef ptrdiff_t difference_type;
00410
00413 typedef T value_type;
00415 typedef XBidiNode<value_type,N,S> node_type;
00417 typedef XData<size_type,difference_type,node_type,value_type,N,S,R> data_type;
00419 friend XList<T,node_type>;
00420 protected:
00421 data_type data;
00422
00424
00428 void Init(double probability,unsigned int maxLevel) {}
00429
00430 public:
00432
00436 XBidiCompositeSkipList() {}
00437
00439
00443 XBidiCompositeSkipList(double probability, unsigned int maxLevel) {}
00444
00446
00452 XBidiCompositeSkipList(size_type maxNodes) {}
00453
00455
00460 XBidiCompositeSkipList(const container_type &source) {}
00461
00463
00470 template<class InIt> XBidiCompositeSkipList(InIt first, InIt last) {}
00471
00473
00479 template<class InIt> XBidiCompositeSkipList(InIt first, InIt last, double probability, unsigned int maxLevel) {}
00480
00482
00490 template<class InIt> XBidiCompositeSkipList(InIt first, InIt last, size_type maxNodes) {}
00491
00493
00496 virtual ~XBidiCompositeSkipList() {}
00497
00499
00505 container_type& operator=(const container_type &source){}
00506
00508
00511 void swap(container_type& right) {}
00512
00514 void clear(){}
00515
00517 void destroy(){}
00518
00520
00523 size_type size() const{}
00524
00526
00529 bool empty() const{}
00530
00532 XList<T,node_type>** getContainers() { return data.Containers; }
00533
00535 typedef XList<T,node_type>** XListArray;
00536
00538 XListArray Containers;
00539 };
00540
00542
00557 template<unsigned int X, class container_type>
00558 class XIterator0 : public std::iterator<std::random_access_iterator_tag, typename container_type::value_type >
00559 {
00560 public:
00561 typedef std::iterator<std::random_access_iterator_tag, typename container_type::value_type > baseclass;
00562 typedef typename baseclass::iterator_category iterator_category;
00563 typedef typename baseclass::value_type value_type;
00564 typedef typename baseclass::difference_type difference_type;
00565 typedef typename baseclass::pointer pointer;
00566 typedef typename baseclass::reference reference;
00567
00568 typedef typename container_type::data_type data_type;
00569 typedef typename container_type::node_type node_type;
00570 typedef typename container_type::size_type size_type;
00571 typedef typename container_type::mapped_type mapped_type;
00572 typedef typename container_type::const_mapped_type const_mapped_type;
00573 typedef typename container_type::mapped_type_reference mapped_type_reference;
00574 typedef typename container_type::const_mapped_type_reference const_mapped_type_reference;
00575
00576 typedef typename container_type::T0 T0;
00577 typedef typename container_type::T1 T1;
00578
00579 typedef XIterator0<X,container_type> self_type;
00580
00581 private:
00582 data_type *data;
00583 mutable size_type Findex;
00584 node_type *FNode;
00585
00586 public:
00588 size_type index;
00589
00591 XIterator0() {}
00592
00594
00597 XIterator0(const T0 &t0) {}
00598
00600
00603 XIterator0(const T1 &t1) {}
00604
00606
00612 XIterator0(data_type *data, node_type* p) {}
00613
00615
00622 XIterator0(data_type *data, node_type* p, size_type index) {}
00623
00625
00632 template<unsigned int nX, class ncontainer_type>
00633 XIterator0(const XIterator0<nX,ncontainer_type> &t0) : data(t0.data), FNode(t0.FNode) { refresh(); }
00634
00636
00643 template<unsigned int nX, class ncontainer_type>
00644 XIterator0(const XIterator1<nX,ncontainer_type> &t1) : data(t1.data), FNode(const_cast<node_type*>(t1.FNode)) { refresh(); }
00645
00647
00654 template<unsigned int nX, class ncontainer_type>
00655 XIterator0(const YIterator0<nX,ncontainer_type> &t0) : data(t0.data), FNode(t0.FNode) { refresh(); }
00656
00658
00665 template<unsigned int nX, class ncontainer_type>
00666 XIterator0(const YIterator1<nX,ncontainer_type> &t1) : data(t1.data), FNode(const_cast<node_type*>(t1.FNode)) { refresh(); }
00667
00669
00677 template<unsigned int nX, class ncontainer_type>
00678 T0& operator=(const XIterator0<nX,ncontainer_type> &t0)
00679 {
00680 this->data = t0->data;
00681 this->FNode = t0->FNode;
00682 refresh();
00683 return *this;
00684 }
00685
00687
00695 template<unsigned int nX, class ncontainer_type>
00696 T0& operator=(const XIterator1<nX,ncontainer_type> &t1)
00697 {
00698 this->data = t1->data;
00699 this->FNode = const_cast<node_type*>(t1.FNode);
00700 refresh();
00701 return *this;
00702 }
00703
00705
00713 template<unsigned int nX, class ncontainer_type>
00714 T0& operator=(const YIterator0<nX,ncontainer_type> &t0)
00715 {
00716 this->data = t0->data;
00717 this->FNode = t0->FNode;
00718 refresh();
00719 return *this;
00720 }
00721
00723
00731 template<unsigned int nX, class ncontainer_type>
00732 T0& operator=(const YIterator1<nX,ncontainer_type> &t1)
00733 {
00734 this->data = t1->data;
00735 this->FNode = const_cast<node_type*>(t1.FNode);
00736 refresh();
00737 return *this;
00738 }
00739
00741 node_type* getNode() const { return FNode; }
00742
00744 void setNode(node_type *n) { FNode = n; }
00745
00747 container_type* getContainer() const {}
00748
00750
00753 bool operator==(const T0& other) const{}
00754
00756
00759 bool operator!=(const T0& other) const{}
00760
00762
00765 bool operator==(const T1& other) const{}
00766
00768
00771 bool operator!=(const T1& other) const{}
00772
00774
00779 T0& operator++(){}
00780
00782
00787 T0 operator++(int){}
00788
00790
00795 T0& operator--(){}
00796
00798
00803 T0 operator--(int){}
00804
00806
00811 reference operator*() const{}
00812
00814
00819 pointer operator->() const{}
00820
00822
00825 bool operator<(const T0 &other) const{}
00826
00828
00831 bool operator<=(const T0 &other) const{}
00832
00834
00837 bool operator>(const T0 &other) const{}
00838
00840
00843 bool operator>=(const T0 &other) const{}
00844
00846
00849 bool operator<(const T1 &other) const{}
00850
00852
00855 bool operator<=(const T1 &other) const{}
00856
00858
00861 bool operator>(const T1 &other) const{}
00862
00864
00867 bool operator>=(const T1 &other) const{}
00868
00870
00874 T0 operator+(difference_type off) const{}
00875
00877
00881 T0 operator-(difference_type off) const{}
00882
00884
00888 T0& operator+=(difference_type off){}
00889
00891
00895 T0& operator-=(difference_type off){}
00896
00898
00902 difference_type operator-(const T0 &other) const{}
00903
00905
00909 difference_type operator-(const T1 &other) const{}
00910
00912
00918 size_type refresh(){}
00919
00921
00925 value_type& operator[](difference_type off) const{}
00926
00928
00931 size_type getIndex() const{}
00932 };
00933
00935
00950 template<unsigned int X, class container_type>
00951 class XIterator1 : public std::iterator<std::random_access_iterator_tag, typename container_type::value_type, typename container_type::difference_type, const typename container_type::pointer, typename container_type::const_reference >
00952 {
00953 public:
00954 typedef std::iterator<std::random_access_iterator_tag, typename container_type::value_type, typename container_type::difference_type, const typename container_type::pointer, typename container_type::const_reference > baseclass;
00955 typedef typename baseclass::iterator_category iterator_category;
00956 typedef typename baseclass::value_type value_type;
00957 typedef typename baseclass::difference_type difference_type;
00958 typedef typename baseclass::pointer pointer;
00959 typedef typename baseclass::reference reference;
00960
00961 typedef typename container_type::data_type data_type;
00962 typedef typename container_type::node_type node_type;
00963 typedef typename container_type::size_type size_type;
00964 typedef typename container_type::mapped_type mapped_type;
00965 typedef typename container_type::const_mapped_type const_mapped_type;
00966 typedef typename container_type::mapped_type_reference mapped_type_reference;
00967 typedef typename container_type::const_mapped_type_reference const_mapped_type_reference;
00968
00969 typedef typename container_type::T0 T0;
00970 typedef typename container_type::T1 T1;
00971
00972 typedef XIterator1<X,container_type> self_type;
00973
00974 private:
00975 data_type *data;
00976 mutable size_type Findex;
00977 node_type *FNode;
00978 public:
00980 size_type index;
00981
00983 XIterator1() {}
00984
00986
00989 XIterator1(const T1 &t1) {}
00990
00992
00995 XIterator1(const T0 &t0) {}
00996
00998
01004 XIterator1(data_type *data, node_type* p) {}
01005
01007
01012 XIterator1(data_type *data, node_type* p, size_type index) {}
01013
01015
01022 template<unsigned int nX, class ncontainer_type>
01023 XIterator1(const XIterator0<nX,ncontainer_type> &t0) : data(t0.data), FNode(t0.FNode) { refresh(); }
01024
01026
01033 template<unsigned int nX, class ncontainer_type>
01034 XIterator1(const XIterator1<nX,ncontainer_type> &t1) : data(t1.data), FNode(t1.FNode) { refresh(); }
01035
01037
01044 template<unsigned int nX, class ncontainer_type>
01045 XIterator1(const YIterator0<nX,ncontainer_type> &t0) : data(t0.data), FNode(t0.FNode) { refresh(); }
01046
01048
01055 template<unsigned int nX, class ncontainer_type>
01056 XIterator1(const YIterator1<nX,ncontainer_type> &t1) : data(t1.data), FNode(t1.FNode) { refresh(); }
01057
01059
01067 template<unsigned int nX, class ncontainer_type>
01068 T1& operator=(const XIterator0<nX,ncontainer_type> &t0)
01069 {
01070 this->data = t0->data;
01071 this->FNode = t0->FNode;
01072 refresh();
01073 return *this;
01074 }
01075
01077
01085 template<unsigned int nX, class ncontainer_type>
01086 T1& operator=(const XIterator1<nX,ncontainer_type> &t1)
01087 {
01088 this->data = t1->data;
01089 this->FNode = t1.FNode;
01090 refresh();
01091 return *this;
01092 }
01093
01095
01103 template<unsigned int nX, class ncontainer_type>
01104 T1& operator=(const YIterator0<nX,ncontainer_type> &t0)
01105 {
01106 this->data = t0->data;
01107 this->FNode = t0->FNode;
01108 refresh();
01109 return *this;
01110 }
01111
01113
01121 template<unsigned int nX, class ncontainer_type>
01122 T1& operator=(const YIterator1<nX,ncontainer_type> &t1)
01123 {
01124 this->data = t1->data;
01125 this->FNode = t1.FNode;
01126 refresh();
01127 return *this;
01128 }
01129
01130
01132 node_type* getNode() const { return FNode; }
01133
01135 void setNode(node_type *n) { FNode = n; }
01136
01138 container_type* getContainer() const {}
01139
01141
01144 bool operator==(const T0& other) const{}
01145
01147
01150 bool operator!=(const T0& other) const{}
01151
01153
01156 bool operator==(const T1& other) const{}
01157
01159
01162 bool operator!=(const T1& other) const{}
01163
01165
01170 T1& operator++(){}
01171
01173
01178 T1 operator++(int){}
01179
01181
01186 T1& operator--(){}
01187
01189
01194 T1 operator--(int){}
01195
01197
01202 reference operator*() const{}
01203
01205
01210 pointer operator->() const{}
01211
01213
01216 bool operator<(const T0 &other) const{}
01217
01219
01222 bool operator<=(const T0 &other) const{}
01223
01225
01228 bool operator>(const T0 &other) const{}
01229
01231
01234 bool operator>=(const T0 &other) const{}
01235
01237
01240 bool operator<(const T1 &other) const{}
01241
01243
01246 bool operator<=(const T1 &other) const{}
01247
01249
01252 bool operator>(const T1 &other) const{}
01253
01255
01258 bool operator>=(const T1 &other) const{}
01259
01261
01265 T1 operator+(difference_type off) const{}
01266
01268
01272 T1 operator-(difference_type off) const{}
01273
01275
01279 T1& operator+=(difference_type off){}
01280
01282
01286 T1& operator-=(difference_type off){}
01287
01289
01293 difference_type operator-(const T0 &other) const{}
01294
01296
01300 difference_type operator-(const T1 &other) const{}
01301
01303
01309 size_type refresh(){}
01310
01312
01316 value_type& operator[](difference_type off) const{}
01317
01319
01322 size_type getIndex() const{}
01323 };
01324
01326
01334 template <unsigned int X, class CT>
01335 class XIndexedSkipList : public XList<typename CT::value_type, typename CT::node_type>
01336 {
01337 public:
01339 typedef size_t size_type;
01341
01344 typedef ptrdiff_t difference_type;
01346 typedef XIndexedSkipList<X,CT> container_type;
01347
01349 typedef XIterator0<X,container_type> T0;
01351 typedef XIterator1<X,container_type> T1;
01352
01353 friend class XIterator0<X,container_type>;
01354 friend class XIterator1<X,container_type>;
01355
01357
01362 typedef T0 iterator;
01364 typedef T1 const_iterator;
01365
01367
01370 typedef typename CT::value_type value_type;
01371 typedef value_type T;
01373 typedef value_type mapped_type;
01375 typedef value_type& mapped_type_reference;
01377 typedef const value_type const_mapped_type;
01379 typedef const value_type& const_mapped_type_reference;
01381 typedef typename CT::node_type node_type;
01383 typedef value_type* pointer;
01385 typedef value_type& reference;
01387 typedef const value_type& const_reference;
01389
01392 typedef std::reverse_iterator<iterator> reverse_iterator;
01394 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
01396 typedef typename CT::data_type data_type;
01397
01399 typedef XTmpContainer<size_type, node_type> tmp_container_type;
01400
01401 private:
01402 data_type *data;
01403
01404
01412 void scan(size_type index) const {}
01413
01415
01423 void scanAll(size_type index) const {}
01424
01426
01435 void scan(const iterator &where) const {}
01436
01438
01447 void scanAll(const iterator &where) const {}
01448
01450
01458 void scan(node_type *nodex) {}
01459
01461
01469 void scanAll(node_type *nodex) {}
01470
01471
01473 size_type& getItems() {}
01475
01478 void setItems(const size_type sz) {}
01479
01481 std::pair<size_type,node_type*>* getUpdate() {}
01482
01484 size_type getScanIndex() const {}
01485
01487
01490 void setScanIndex(const size_type sz) {}
01491
01493 typedef std::pair<size_type,node_type*>* pair_t;
01494
01495 public:
01496
01498 XIndexedSkipList() { }
01499
01501 ~XIndexedSkipList() {}
01502
01504
01511 void setData(void *data) {}
01512
01514 data_type* getData() { return this->data; }
01515
01517
01523 container_type& operator=(const container_type &source) {}
01524
01526
01529 iterator begin(){}
01530
01532
01535 iterator end(){}
01536
01538
01541 const_iterator begin() const{}
01542
01544
01547 const_iterator end() const{}
01548
01550
01553 reverse_iterator rbegin(){}
01554
01556
01559 reverse_iterator rend(){}
01560
01562
01565 const_reverse_iterator rbegin() const{}
01566
01568
01571 const_reverse_iterator rend() const{}
01572
01574
01577 size_type size() const{}
01578
01580
01583 bool empty() const{}
01584
01586
01589 reference front(){}
01590
01592
01595 const_reference front() const{}
01596
01598
01601 reference back(){}
01602
01604
01607 const_reference back() const{}
01608
01610
01616 void push_front(const value_type &val){}
01617
01619 void pop_front(){}
01620
01622 void destroy_front(){}
01623
01625
01631 void push_back(const value_type &val){}
01632
01634 void pop_back(){}
01635
01637 void destroy_back(){}
01638
01640
01647 template<class InIt> void assign(InIt first, InIt last){}
01648
01650
01654 void assign(size_type count, const T& val) {}
01655
01657
01661 void insert(node_type *node) {}
01662
01664
01670 void erase(node_type *node) {}
01671
01673
01680 iterator insert(const T &val) {}
01681
01682
01684
01688 iterator erase(const iterator &where){}
01689
01691
01695 iterator destroy(const iterator &where){}
01696
01698
01705 iterator erase(const iterator &first, const iterator &last){}
01706
01708
01715 iterator destroy(const iterator &first, const iterator &last){}
01716
01718
01722 iterator erase_index(size_type index);
01723
01725
01729 iterator destroy_index(size_type index);
01730
01732 void clear(){}
01733
01735 void destroy(){}
01736
01738
01741 void swap(container_type& right) {}
01742
01744
01751 mapped_type_reference value(reference value) const {}
01752
01754
01761 const_mapped_type_reference value(const_reference value) const {return value;}
01762
01764
01770 mapped_type_reference operator[](size_type index){}
01771
01773
01779 const_mapped_type_reference operator[](size_type index) const{}
01780
01782
01788 mapped_type_reference at(size_type off){}
01789
01791
01797 const_mapped_type_reference at(size_type off) const{}
01798
01800 size_type max_size() const{}
01801
01803 void resize(size_type newsize){}
01804
01806 void resize(size_type newsize, const value_type &val){}
01807
01809
01814 iterator insert(const iterator &where, const value_type& val){}
01815
01817
01822 void insert(const iterator &where, size_type count, const T& val){}
01823
01825
01830 template<class InIt> void insert(const iterator &where, InIt first, InIt last){}
01831
01833
01836 void reverse(){}
01837
01839
01845 void unique(){}
01846
01848
01856 template<class Pr2> void unique(Pr2 pred){}
01857
01859
01866 void sort(){}
01867
01869
01878 template<class Pr3> void sort(Pr3 pred){}
01879
01881
01888 void stable_sort(){}
01889
01891
01900 template<class Pr3> void stable_sort(Pr3 pred){}
01901
01903
01909 void erase_value(const value_type& val){}
01910
01912
01918 template<class Pr1> void erase_if(Pr1 pred);
01919
01921
01927 template<class Pr4> void destroy_if(Pr4 pred);
01928
01930
01942 void move(const iterator &dest, const iterator &source) {}
01943
01945
01959 void move(const iterator &dest, const iterator &first, const iterator &last) {}
01960
01962
01975 void swap(const iterator &left, const iterator &right) {}
01976
01978
01997 void swap(const iterator &first1, const iterator &last1, const iterator &first2, const iterator &last2) {}
01998
02000
02013 void cut(const iterator &first, const iterator &last, tmp_container_type& right) {}
02014
02016
02028 void cut(const iterator &where, tmp_container_type& right) {}
02029
02031
02044 void splice(const iterator &where, tmp_container_type& right) {}
02045
02046 };
02047
02049
02054 template <int X, class CT>
02055 bool operator==(const XIndexedSkipList<X,CT> &left, const XIndexedSkipList<X,CT> &right)
02056 {
02057 return ((left.size() == right.size()) &&
02058 (std::equal(left.begin(), left.end(), right.begin())));
02059
02060 }
02061
02063
02068 template <int X, class CT>
02069 bool operator!=(const XIndexedSkipList<X,CT> &left, const XIndexedSkipList<X,CT> &right)
02070 {
02071 return !(left==right);
02072 }
02073
02075
02080 template <int X, class CT>
02081 bool operator<(const XIndexedSkipList<X,CT> &left, const XIndexedSkipList<X,CT> &right)
02082 {
02083 return lexicographical_compare(left.begin(),left.end(),right.begin(),right.end(),left.value_comp());
02084 }
02085
02087
02092 template <int X, class CT>
02093 bool operator<=(const XIndexedSkipList<X,CT> &left, const XIndexedSkipList<X,CT> &right)
02094 {
02095 return !(right < left);
02096 }
02097
02099
02104 template <int X, class CT>
02105 bool operator>(const XIndexedSkipList<X,CT> &left, const XIndexedSkipList<X,CT> &right)
02106 {
02107 return (right < left);
02108 }
02109
02111
02116 template <int X, class CT>
02117 bool operator>=(const XIndexedSkipList<X,CT> &left, const XIndexedSkipList<X,CT> &right)
02118 {
02119 return !(left < right);
02120 }
02121
02122
02124
02142 template<int X, class container_type, class Pr>
02143 CS::XIterator0<X,container_type> scan(const CS::XIterator0<X,container_type> &first, const CS::XIterator0<X,container_type> &last, typename container_type::const_reference value, const Pr &pred) {}
02144
02146
02157 template <int X, class CT, class Pr = std::less<typename CT::value_type> >
02158 class XMultiAutoSkipList : public XList<typename CT::value_type, typename CT::node_type>
02159 {
02160 public:
02162 typedef size_t size_type;
02164
02167 typedef ptrdiff_t difference_type;
02169 typedef XMultiAutoSkipList<X,CT,Pr> container_type;
02170
02172 typedef XIterator0<X,container_type> T0;
02174 typedef XIterator1<X,container_type> T1;
02175
02176 friend class XIterator0<X,container_type>;
02177 friend class XIterator1<X,container_type>;
02178
02180
02185 typedef T0 iterator;
02187 typedef T1 const_iterator;
02188
02190
02193 typedef typename CT::value_type value_type;
02194 typedef value_type T;
02196 typedef value_type key_type;
02198 typedef T mapped_type;
02200 typedef T& mapped_type_reference;
02202 typedef const value_type const_mapped_type;
02204 typedef const value_type& const_mapped_type_reference;
02206 typedef typename CT::node_type node_type;
02208 typedef value_type* pointer;
02210 typedef value_type& reference;
02212 typedef const value_type& const_reference;
02214
02217 typedef std::reverse_iterator<iterator> reverse_iterator;
02219 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
02221 typedef typename CT::data_type data_type;
02223 typedef std::pair<iterator, iterator> ipair;
02225 typedef std::pair<const_iterator, const_iterator> const_ipair;
02227 typedef Pr key_compare;
02229 typedef Pr value_compare;
02230
02231 private:
02232 data_type *data;
02233
02234 Pr Compare;
02235
02237
02245 void scan(size_type index) const {}
02246
02248
02256 void scanAll(size_type index) const {}
02257
02259
02268 void scan(const iterator &where) const {}
02269
02271
02280 void scanAll(const iterator &where) const {}
02281
02283
02291 void scan(node_type *nodex) {}
02292
02294
02302 void scanAll(node_type *nodex) {}
02303
02305
02313 void scan_val(const value_type &val) const {}
02314
02316
02324 void scanAll_val(const value_type &val) const {}
02325
02327
02335 void scan_val(const key_type &val) const {}
02336
02338
02346 void scanAll_val(const key_type &val) const {}
02347
02349 size_type& getItems() {}
02351
02354 void setItems(const size_type sz) {}
02355
02357 std::pair<size_type,node_type*>* getUpdate() {}
02358
02360 size_type getScanIndex() const {}
02361
02363
02366 void setScanIndex(const size_type sz) {}
02367
02369 typedef std::pair<size_type,node_type*>* pair_t;
02370
02371 public:
02373 XMultiAutoSkipList() { }
02374
02376
02379 explicit XMultiAutoSkipList(const key_compare& comp) : Compare(comp) { }
02380
02382 ~XMultiAutoSkipList() {}
02383
02385
02392 void setData(void *data) {}
02393
02395 data_type* getData() {}
02396
02398
02404 container_type& operator=(const container_type &source) {}
02405
02407
02410 iterator begin(){}
02411
02413
02416 iterator end(){}
02417
02419
02422 const_iterator begin() const{}
02423
02425
02428 const_iterator end() const{}
02429
02431
02434 reverse_iterator rbegin(){}
02435
02437
02440 reverse_iterator rend(){}
02441
02443
02446 const_reverse_iterator rbegin() const{}
02447
02449
02452 const_reverse_iterator rend() const{}
02453
02455
02458 size_type size() const{}
02459
02461
02464 bool empty() const{}
02465
02467
02470 reference front(){}
02471
02473
02476 const_reference front() const{}
02477
02479
02482 reference back(){}
02483
02485
02488 const_reference back() const{}
02489
02491 void pop_front(){}
02492
02494 void destroy_front(){}
02495
02497 void pop_back(){}
02498
02500 void destroy_back(){}
02501
02503
02510 template<class InIt> void assign(InIt first, InIt last){}
02511
02513
02517 iterator insert(const value_type& val){}
02518
02520
02526 iterator insert(const iterator &where, const value_type& val) {}
02527
02529
02533 template<class InIt> void insert(InIt first, InIt last) {}
02534
02536
02540 iterator erase(const iterator &where){}
02541
02543
02547 iterator destroy(const iterator &where){}
02548
02550
02557 iterator erase(const iterator &first, const iterator &last){}
02558
02560
02567 iterator destroy(const iterator &first, const iterator &last){}
02568
02570
02574 size_type erase(const key_type &keyval){}
02575
02577
02581 size_type destroy(const key_type &keyval){}
02582
02584
02588 iterator erase_index(size_type index);
02589
02591
02595 iterator destroy_index(size_type index);
02596
02598 void clear(){}
02599
02601 void destroy(){}
02602
02604
02607 void swap(container_type& right) {}
02608
02610
02616 template<class Pr1> void erase_if(Pr1 pred);
02617
02619
02625 template<class Pr4> void destroy_if(Pr4 pred);
02626
02628
02634 void unique(){}
02635
02637
02645 template<class Pr2> void unique(Pr2 pred){}
02646
02648
02654 mapped_type_reference operator[](size_type index){}
02655
02657
02663 const_mapped_type_reference operator[](size_type index) const{}
02664
02666
02672 mapped_type_reference at(size_type off){}
02673
02675
02681 const_mapped_type_reference at(size_type off) const{}
02682
02684 key_compare key_comp() const { }
02685
02687 value_compare value_comp() const { }
02688
02690 size_type max_size() const{}
02691
02693
02700 const key_type& key(const value_type& value) const {}
02701
02703
02710 mapped_type_reference value(reference value) const {}
02711
02713
02720 const_mapped_type_reference value(const_reference value) const {}
02721
02723
02727 iterator find(const key_type& keyval) {}
02728
02730
02734 const_iterator find(const key_type& keyval) const {}
02735
02737
02741 size_type count(const key_type& keyval) const {}
02742
02744
02748 iterator lower_bound(const key_type& keyval) {}
02749
02751
02755 const_iterator lower_bound(const key_type& keyval) const {}
02756
02758
02762 iterator upper_bound(const key_type& keyval) {}
02763
02765
02769 const_iterator upper_bound(const key_type& keyval) const {}
02770
02772
02776 ipair equal_range(const key_type& keyval) {}
02777
02779
02783 const_ipair equal_range(const key_type& keyval) const {}
02784
02785 };
02786
02788
02793 template <int X, class CT, class Pr>
02794 bool operator==(const XMultiAutoSkipList<X,CT,Pr> &left, const XMultiAutoSkipList<X,CT,Pr> &right)
02795 {
02796 return ((left.size() == right.size()) &&
02797 (std::equal(left.begin(), left.end(), right.begin())));
02798 }
02799
02801
02806 template <int X, class CT, class Pr>
02807 bool operator!=(const XMultiAutoSkipList<X,CT,Pr> &left, const XMultiAutoSkipList<X,CT,Pr> &right)
02808 {
02809 return !(left==right);
02810 }
02811
02813
02818 template <int X, class CT, class Pr>
02819 bool operator<(const XMultiAutoSkipList<X,CT,Pr> &left, const XMultiAutoSkipList<X,CT,Pr> &right)
02820 {
02821 return lexicographical_compare(left.begin(),left.end(),right.begin(),right.end(),left.value_comp());
02822 }
02823
02825
02830 template <int X, class CT, class Pr>
02831 bool operator<=(const XMultiAutoSkipList<X,CT,Pr> &left, const XMultiAutoSkipList<X,CT,Pr> &right)
02832 {
02833 return !(right < left);
02834 }
02835
02837
02842 template <int X, class CT, class Pr>
02843 bool operator>(const XMultiAutoSkipList<X,CT,Pr> &left, const XMultiAutoSkipList<X,CT,Pr> &right)
02844 {
02845 return (right < left);
02846 }
02847
02849
02854 template <int X, class CT, class Pr>
02855 bool operator>=(const XMultiAutoSkipList<X,CT,Pr> &left, const XMultiAutoSkipList<X,CT,Pr> &right)
02856 {
02857 return !(left < right);
02858 }
02859
02861
02875 template <unsigned int X, class K, class CT, class A=XAccessSelf<K,typename CT::value_type>, class Pr = std::less<K> >
02876 class XMultiAutoAccessSkipList : public XList<typename CT::value_type, typename CT::node_type>
02877 {
02878 public:
02880 typedef size_t size_type;
02882
02885 typedef ptrdiff_t difference_type;
02887 typedef XMultiAutoAccessSkipList<X,K,CT,A,Pr> container_type;
02888
02890 typedef XIterator0<X,container_type> T0;
02892 typedef XIterator1<X,container_type> T1;
02893
02894 friend class XIterator0<X,container_type>;
02895 friend class XIterator1<X,container_type>;
02896
02898
02903 typedef T0 iterator;
02905 typedef T1 const_iterator;
02906
02908
02911 typedef typename CT::value_type value_type;
02912 typedef value_type T;
02914 typedef K key_type;
02916 typedef T mapped_type;
02918 typedef T& mapped_type_reference;
02920 typedef const value_type const_mapped_type;
02922 typedef const value_type& const_mapped_type_reference;
02924 typedef typename CT::node_type node_type;
02926 typedef value_type* pointer;
02928 typedef value_type& reference;
02930 typedef const value_type& const_reference;
02932
02935 typedef std::reverse_iterator<iterator> reverse_iterator;
02937 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
02939 typedef typename CT::data_type data_type;
02941 typedef std::pair<iterator, iterator> ipair;
02943 typedef std::pair<const_iterator, const_iterator> const_ipair;
02945 typedef Pr key_compare;
02946
02948 class value_compare
02949 : public std::binary_function<value_type, value_type, bool>
02950 {
02951 friend container_type;
02952 public:
02953 bool operator()(const value_type& left, const value_type& right) const
02954 {return (comp(left.first, right.first)); }
02955 protected:
02956 value_compare(const key_compare &pr) : comp(pr) {}
02957 key_compare comp;
02958 };
02959
02960 private:
02961 data_type *data;
02962 A a;
02963 key_compare KeyCompare;
02964 value_compare ValueCompare;
02965
02967
02975 void scan(size_type index) const {}
02976
02978
02986 void scanAll(size_type index) const {}
02987
02989
02998 void scan(const iterator &where) const {}
02999
03001
03010 void scanAll(const iterator &where) const {}
03011
03013
03021 void scan(node_type *nodex) {}
03022
03024
03032 void scanAll(node_type *nodex) {}
03033
03035
03043 void scan_val(const value_type &val) const {}
03044
03046
03054 void scanAll_val(const value_type &val) const {}
03055
03057
03065 void scan_val(const key_type &val) const {}
03066
03068
03076 void scanAll_val(const key_type &val) const {}
03077
03079 size_type& getItems() {}
03081
03084 void setItems(const size_type sz) {}
03085
03087 std::pair<size_type,node_type*>* getUpdate() {}
03088
03090 size_type getScanIndex() const {}
03091
03093
03096 void setScanIndex(const size_type sz) {}
03097
03099 typedef std::pair<size_type,node_type*>* pair_t;
03100
03101 public:
03103 XMultiAutoAcessSkipList() { }
03104
03106
03109 explicit XMultiAutoAcessSkipList(const key_compare& comp) : Compare(comp) { }
03110
03112 ~XMultiAutoAcessSkipList() {}
03113
03115
03122 void setData(void *data) {}
03123
03125 data_type* getData() {}
03126
03128
03134 container_type& operator=(const container_type &source) {}
03135
03137
03140 iterator begin(){}
03141
03143
03146 iterator end(){}
03147
03149
03152 const_iterator begin() const{}
03153
03155
03158 const_iterator end() const{}
03159
03161
03164 reverse_iterator rbegin(){}
03165
03167
03170 reverse_iterator rend(){}
03171
03173
03176 const_reverse_iterator rbegin() const{}
03177
03179
03182 const_reverse_iterator rend() const{}
03183
03185
03188 size_type size() const{}
03189
03191
03194 bool empty() const{}
03195
03197
03200 reference front(){}
03201
03203
03206 const_reference front() const{}
03207
03209
03212 reference back(){}
03213
03215
03218 const_reference back() const{}
03219
03221 void pop_front(){}
03222
03224 void destroy_front(){}
03225
03227 void pop_back(){}
03228
03230 void destroy_back(){}
03231
03233
03240 template<class InIt> void assign(InIt first, InIt last){}
03241
03243
03247 iterator insert(const value_type& val){}
03248
03250
03256 iterator insert(const iterator &where, const value_type& val) {}
03257
03259
03263 template<class InIt> void insert(InIt first, InIt last) {}
03264
03266
03270 iterator erase(const iterator &where){}
03271
03273
03277 iterator destroy(const iterator &where){}
03278
03280
03287 iterator erase(const iterator &first, const iterator &last){}
03288
03290
03297 iterator destroy(const iterator &first, const iterator &last){}
03298
03300
03304 size_type erase(const key_type &keyval){}
03305
03307
03311 size_type destroy(const key_type &keyval){}
03312
03314
03318 iterator erase_index(size_type index);
03319
03321
03325 iterator destroy_index(size_type index);
03326
03328 void clear(){}
03329
03331 void destroy(){}
03332
03334
03337 void swap(container_type& right) {}
03338
03340
03346 template<class Pr1> void erase_if(Pr1 pred);
03347
03349
03355 template<class Pr4> void destroy_if(Pr4 pred);
03356
03358
03364 void unique(){}
03365
03367
03375 template<class Pr2> void unique(Pr2 pred){}
03376
03378
03384 mapped_type_reference operator[](size_type index){}
03385
03387
03393 const_mapped_type_reference operator[](size_type index) const{}
03394
03396
03402 mapped_type_reference at(size_type off){}
03403
03405
03411 const_mapped_type_reference at(size_type off) const{}
03412
03414 key_compare key_comp() const { }
03415
03417 value_compare value_comp() const { }
03418
03420 size_type max_size() const{}
03421
03423
03430 const key_type& key(const value_type& value) const {}
03431
03433
03440 mapped_type_reference value(reference value) const {}
03441
03443
03450 const_mapped_type_reference value(const_reference value) const {}
03451
03453
03457 iterator find(const key_type& keyval) {}
03458
03460
03464 const_iterator find(const key_type& keyval) const {}
03465
03467
03471 size_type count(const key_type& keyval) const {}
03472
03474
03478 iterator lower_bound(const key_type& keyval) {}
03479
03481
03485 const_iterator lower_bound(const key_type& keyval) const {}
03486
03488
03492 iterator upper_bound(const key_type& keyval) {}
03493
03495
03499 const_iterator upper_bound(const key_type& keyval) const {}
03500
03502
03506 ipair equal_range(const key_type& keyval) {}
03507
03509
03513 const_ipair equal_range(const key_type& keyval) const {}
03514
03515 };
03516
03518
03523 template <unsigned int X, class K, class CT, class A, class Pr>
03524 bool operator==(const XMultiAutoAcessSkipList<X,K,CT,A,Pr> &left, const XMultiAutoAcessSkipList<X,K,CT,A,Pr> &right)
03525 {
03526 return ((left.size() == right.size()) &&
03527 (std::equal(left.begin(), left.end(), right.begin())));
03528 }
03529
03531
03536 template <unsigned int X, class K, class CT, class A, class Pr>
03537 bool operator!=(const XMultiAutoAcessSkipList<X,K,CT,A,Pr> &left, const XMultiAutoAcessSkipList<X,K,CT,A,Pr> &right)
03538 {
03539 return !(left==right);
03540 }
03541
03543
03548 template <unsigned int X, class K, class CT, class A, class Pr>
03549 bool operator<(const XMultiAutoAcessSkipList<X,K,CT,A,Pr> &left, const XMultiAutoAcessSkipList<X,K,CT,A,Pr> &right)
03550 {
03551 return lexicographical_compare(left.begin(),left.end(),right.begin(),right.end(),left.value_comp());
03552 }
03553
03555
03560 template <unsigned int X, class K, class CT, class A, class Pr>
03561 bool operator<=(const XMultiAutoAcessSkipList<X,K,CT,A,Pr> &left, const XMultiAutoAcessSkipList<X,K,CT,A,Pr> &right)
03562 {
03563 return !(right < left);
03564 }
03565
03567
03572 template <unsigned int X, class K, class CT, class A, class Pr>
03573 bool operator>(const XMultiAutoAcessSkipList<X,K,CT,A,Pr> &left, const XMultiAutoAcessSkipList<X,K,CT,A,Pr> &right)
03574 {
03575 return (right < left);
03576 }
03577
03579
03584 template <unsigned int X, class K, class CT, class A, class Pr>
03585 bool operator>=(const XMultiAutoAcessSkipList<X,K,CT,A,Pr> &left, const XMultiAutoAcessSkipList<X,K,CT,A,Pr> &right)
03586 {
03587 return !(left < right);
03588 }
03589
03591
03600 template<unsigned int X, class container_type>
03601 class YIterator0 : public std::iterator<std::bidirectional_iterator_tag, typename container_type::value_type>
03602 {
03603 public:
03604 typedef std::iterator<std::bidirectional_iterator_tag, typename container_type::value_type> baseclass;
03605 typedef typename baseclass::iterator_category iterator_category;
03606 typedef typename baseclass::value_type value_type;
03607 typedef typename baseclass::difference_type difference_type;
03608 typedef typename baseclass::pointer pointer;
03609 typedef typename baseclass::reference reference;
03610
03611 typedef typename container_type::data_type data_type;
03612 typedef typename container_type::node_type node_type;
03613 typedef typename container_type::size_type size_type;
03614 typedef typename container_type::mapped_type mapped_type;
03615 typedef typename container_type::const_mapped_type const_mapped_type;
03616 typedef typename container_type::mapped_type_reference mapped_type_reference;
03617 typedef typename container_type::const_mapped_type_reference const_mapped_type_reference;
03618
03619 typedef typename container_type::T0 T0;
03620 typedef typename container_type::T1 T1;
03621
03622 private:
03623 data_type *data;
03624 node_type *FNode;
03625 public:
03627 node_type *node;
03628
03630 YIterator0() {}
03631
03633
03636 YIterator0(const T0 &t0) {}
03637
03639
03642 YIterator0(const T1 &t1) {}
03643
03645
03649 YIterator0(data_type *data, node_type* p) {}
03650
03652
03659 template<int nX, class ncontainer_type>
03660 YIterator0(const XIterator0<nX,ncontainer_type> &t0) : data(t0.data), FNode(t0.FNode) {}
03661
03663
03670 template<int nX, class ncontainer_type>
03671 YIterator0(const XIterator1<nX,ncontainer_type> &t1) : data(t1.data), FNode(const_cast<node_type*>(t1.FNode)) {}
03672
03674
03681 template<int nX, class ncontainer_type>
03682 YIterator0(const YIterator0<nX,ncontainer_type> &t0) : data(t0.data), FNode(t0.FNode) {}
03683
03685
03692 template<int nX, class ncontainer_type>
03693 YIterator0(const YIterator1<nX,ncontainer_type> &t1) : data(t1.data), FNode(const_cast<node_type*>(t1.FNode)) {}
03694
03696
03704 template<int nX, class ncontainer_type>
03705 T0& operator=(const XIterator0<nX,ncontainer_type> &t0)
03706 {
03707 this->data = t0->data;
03708 this->FNode = t0->FNode;
03709 return *this;
03710 }
03711
03713
03721 template<int nX, class ncontainer_type>
03722 T0& operator=(const XIterator1<nX,ncontainer_type> &t1)
03723 {
03724 this->data = t1->data;
03725 this->FNode = const_cast<node_type*>(t1.FNode);
03726 return *this;
03727 }
03728
03730
03738 template<int nX, class ncontainer_type>
03739 T0& operator=(const YIterator0<nX,ncontainer_type> &t0)
03740 {
03741 this->data = t0->data;
03742 this->FNode = t0->FNode;
03743 return *this;
03744 }
03745
03747
03755 template<int nX, class ncontainer_type>
03756 T0& operator=(const YIterator1<nX,ncontainer_type> &t1)
03757 {
03758 this->data = t1->data;
03759 this->FNode = const_cast<node_type*>(t1.FNode);
03760 return *this;
03761 }
03762
03764 node_type* getNode() const { return FNode; }
03765
03767 void setNode(node_type *n) { FNode = n; }
03768
03770 container_type* getContainer() const {}
03771
03773
03776 bool operator==(const T0& other) const{}
03777
03779
03782 bool operator!=(const T0& other) const{}
03783
03785
03788 bool operator==(const T1& other) const{}
03789
03791
03794 bool operator!=(const T1& other) const{}
03795
03797
03802 T0& operator++(){}
03803
03805
03810 T0 operator++(int){}
03811
03813
03818 T0& operator--(){}
03819
03821
03826 T0 operator--(int){}
03827
03829
03834 reference operator*() const{}
03835
03837
03842 pointer operator->() const{}
03843
03845
03848 bool operator<(const T0 &other) const{}
03849
03851
03854 bool operator<=(const T0 &other) const{}
03855
03857
03860 bool operator>(const T0 &other) const{}
03861
03863
03866 bool operator>=(const T0 &other) const{}
03867
03869
03872 bool operator<(const T1 &other) const{}
03873
03875
03878 bool operator<=(const T1 &other) const{}
03879
03881
03884 bool operator>(const T1 &other) const{}
03885
03887
03890 bool operator>=(const T1 &other) const{}
03891
03892 };
03893
03895
03900 template<unsigned int X, class container_type>
03901 class YIterator1 : public std::iterator<std::bidirectional_iterator_tag, typename container_type::value_type, typename container_type::difference_type, const typename container_type::pointer, typename container_type::const_reference >
03902 {
03903 public:
03904 typedef std::iterator<std::bidirectional_iterator_tag, typename container_type::value_type, typename container_type::difference_type, const typename container_type::pointer, typename container_type::const_reference> baseclass;
03905 typedef typename baseclass::iterator_category iterator_category;
03906 typedef typename baseclass::value_type value_type;
03907 typedef typename baseclass::difference_type difference_type;
03908 typedef typename baseclass::pointer pointer;
03909 typedef typename baseclass::reference reference;
03910
03911 typedef typename container_type::data_type data_type;
03912 typedef typename container_type::node_type node_type;
03913 typedef typename container_type::size_type size_type;
03914 typedef typename container_type::mapped_type mapped_type;
03915 typedef typename container_type::const_mapped_type const_mapped_type;
03916 typedef typename container_type::mapped_type_reference mapped_type_reference;
03917 typedef typename container_type::const_mapped_type_reference const_mapped_type_reference;
03918
03919 typedef typename container_type::T0 T0;
03920 typedef typename container_type::T1 T1;
03921
03922 private:
03923 data_type *data;
03924 node_type *FNode;
03925 public:
03927 YIterator1() {}
03928
03930
03933 YIterator1(const T1 &t1) {}
03934
03936
03939 YIterator1(const T0 &t0) {}
03940
03942
03946 YIterator1(const data_type *data, node_type* p) {}
03947
03949
03956 template<int nX, class ncontainer_type>
03957 YIterator1(const XIterator0<nX,ncontainer_type> &t0) : data(t0.data), FNode(t0.FNode) {}
03958
03960
03967 template<int nX, class ncontainer_type>
03968 YIterator1(const XIterator1<nX,ncontainer_type> &t1) : data(t1.data), FNode(t1.FNode) {}
03970
03977 template<int nX, class ncontainer_type>
03978 YIterator1(const YIterator0<nX,ncontainer_type> &t0) : data(t0.data), FNode(t0.FNode) {}
03979
03981
03988 template<int nX, class ncontainer_type>
03989 YIterator1(const YIterator1<nX,ncontainer_type> &t1) : data(t1.data), FNode(t1.FNode) {}
03990
03992
04000 template<int nX, class ncontainer_type>
04001 T1& operator=(const XIterator0<nX,ncontainer_type> &t0)
04002 {
04003 this->data = t0->data;
04004 this->FNode = t0->FNode;
04005 return *this;
04006 }
04007
04009
04017 template<int nX, class ncontainer_type>
04018 T1& operator=(const XIterator1<nX,ncontainer_type> &t1)
04019 {
04020 this->data = t1->data;
04021 this->FNode = t1.FNode;
04022 return *this;
04023 }
04024
04026
04034 template<int nX, class ncontainer_type>
04035 T1& operator=(const YIterator0<nX,ncontainer_type> &t0)
04036 {
04037 this->data = t0->data;
04038 this->FNode = t0->FNode;
04039 return *this;
04040 }
04041
04043
04051 template<int nX, class ncontainer_type>
04052 T1& operator=(const YIterator1<nX,ncontainer_type> &t1)
04053 {
04054 this->data = t1->data;
04055 this->FNode = t1.FNode;
04056 return *this;
04057 }
04058
04060 node_type* getNode() const { return FNode; }
04061
04063 void setNode(node_type *n) { FNode = n; }
04064
04066 container_type* getContainer() const {}
04067
04069
04072 bool operator==(const T0& other) const{}
04073
04075
04078 bool operator!=(const T0& other) const{}
04079
04081
04084 bool operator==(const T1& other) const{}
04085
04087
04090 bool operator!=(const T1& other) const{}
04091
04093
04098 T1& operator++(){}
04099
04101
04106 T1 operator++(int){}
04107
04109
04114 T1& operator--(){}
04115
04117
04122 T1 operator--(int){}
04123
04125
04130 reference operator*() const{}
04131
04133
04138 pointer operator->() const{}
04139
04141
04144 bool operator<(const T0 &other) const{}
04145
04147
04150 bool operator<=(const T0 &other) const{}
04151
04153
04156 bool operator>(const T0 &other) const{}
04157
04159
04162 bool operator>=(const T0 &other) const{}
04163
04165
04168 bool operator<(const T1 &other) const{}
04169
04171
04174 bool operator<=(const T1 &other) const{}
04175
04177
04180 bool operator>(const T1 &other) const{}
04181
04183
04186 bool operator>=(const T1 &other) const{}
04187
04188 };
04189
04190
04192
04202 template <unsigned int X, class CT, class Pr = std::less<typename CT::value_type> >
04203 class XMultiSkipList : public XList<typename CT::value_type, typename CT::node_type>
04204 {
04205 public:
04207 typedef size_t size_type;
04209
04212 typedef ptrdiff_t difference_type;
04214 typedef XMultiSkipList<X,CT,Pr> container_type;
04215
04217 typedef YIterator0<X,container_type> T0;
04219 typedef YIterator1<X,container_type> T1;
04220
04221 friend class YIterator0<X,container_type>;
04222 friend class YIterator1<X,container_type>;
04223
04225
04230 typedef T0 iterator;
04232 typedef T1 const_iterator;
04233
04235
04238 typedef typename CT::value_type value_type;
04239 typedef value_type T;
04241 typedef value_type key_type;
04243 typedef value_type mapped_type;
04245 typedef value_type& mapped_type_reference;
04247 typedef const value_type const_mapped_type;
04249 typedef const value_type& const_mapped_type_reference;
04251 typedef typename CT::node_type node_type;
04253 typedef value_type* pointer;
04255 typedef value_type& reference;
04257 typedef const value_type& const_reference;
04259
04262 typedef std::reverse_iterator<iterator> reverse_iterator;
04264 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
04266 typedef typename CT::data_type data_type;
04267
04269 typedef std::pair<iterator, iterator> ipair;
04271 typedef std::pair<const_iterator, const_iterator> const_ipair;
04272
04274 typedef Pr key_compare;
04276 typedef Pr value_compare;
04277
04278 private:
04279 data_type *data;
04280
04281 Pr Compare;
04282
04284
04293 void scan(const iterator &where) const {}
04294
04296
04305 void scanAll(const iterator &where) const {}
04306
04308
04316 void scan(node_type *nodex) {}
04317
04319
04327 void scanAll(node_type *nodex) {}
04328
04330
04338 void scan_val(const value_type &val) const {}
04339
04341
04349 void scanAll_val(const value_type &val) const {}
04350
04352
04360 void scan_val(const key_type &val) const {}
04361
04363
04371 void scanAll_key(const key_type &val) const {}
04372
04374 size_type& getItems() {}
04376
04379 void setItems(const size_type sz) {}
04380
04382 std::pair<size_type,node_type*>* getUpdate() {}
04383
04385 size_type getScanIndex() const {}
04386
04388
04391 void setScanIndex(const size_type sz) {}
04392
04394 typedef std::pair<size_type,node_type*>* pair_t;
04395
04396 public:
04398 XMultiSkipList() {}
04399
04401 ~XMultiSkipList() {}
04402
04404
04411 void setData(void *data) {}
04412
04414 data_type* getData() {}
04415
04417
04423 container_type& operator=(const container_type &source) {}
04424
04426
04429 iterator begin(){}
04430
04432
04435 iterator end(){}
04436
04438
04441 const_iterator begin() const{}
04442
04444
04447 const_iterator end() const{}
04448
04450
04453 reverse_iterator rbegin(){}
04454
04456
04459 reverse_iterator rend(){}
04460
04462
04465 const_reverse_iterator rbegin() const{}
04466
04468
04471 const_reverse_iterator rend() const{}
04472
04474
04477 size_type size() const{}
04478
04480
04483 bool empty() const{}
04484
04486
04489 reference front(){}
04490
04492
04495 const_reference front() const{}
04496
04498
04501 reference back(){}
04502
04504
04507 const_reference back() const{}
04508
04510 void pop_front(){}
04511
04513 void destroy_front(){}
04514
04516 void pop_back(){}
04517
04519 void destroy_back(){}
04520
04522
04529 template<class InIt> void assign(InIt first, InIt last){}
04530
04532
04536 iterator insert(const value_type& val){}
04537
04539
04545 iterator insert(const iterator &where, const value_type& val) {}
04546
04548
04552 template<class InIt> void insert(InIt first, InIt last) {}
04553
04555
04559 iterator erase(const iterator &where){}
04560
04562
04566 iterator destroy(const iterator &where){}
04567
04569
04576 iterator erase(const iterator &first, const iterator &last){}
04577
04579
04586 iterator destroy(const iterator &first, const iterator &last){}
04587
04589
04593 size_type erase(const key_type &keyval){}
04594
04596
04600 size_type destroy(const key_type &keyval){}
04601
04603 void clear(){}
04604
04606 void destroy(){}
04607
04609
04612 void swap(container_type& right) {}
04613
04615
04621 template<class Pr1> void erase_if(Pr1 pred);
04622
04624
04630 template<class Pr4> void destroy_if(Pr4 pred);
04631
04633
04639 void unique(){}
04640
04642
04650 template<class Pr2> void unique(Pr2 pred){}
04651
04653 key_compare key_comp() const { }
04654
04656 value_compare value_comp() const { }
04657
04659 size_type max_size() const{}
04660
04662
04669 const key_type& key(const value_type& value) const {}
04670
04672
04679 mapped_type_reference value(reference value) const {}
04680
04682
04689 const_mapped_type_reference value(const_reference value) const {return value;}
04690
04692
04696 iterator find(const key_type& keyval) {}
04697
04699
04703 const_iterator find(const key_type& keyval) const {}
04704
04706
04710 size_type count(const key_type& keyval) const {}
04711
04713
04717 iterator lower_bound(const key_type& keyval) {}
04718
04720
04724 const_iterator lower_bound(const key_type& keyval) const {}
04725
04727
04731 iterator upper_bound(const key_type& keyval) {}
04732
04734
04738 const_iterator upper_bound(const key_type& keyval) const {}
04739
04741
04745 ipair equal_range(const key_type& keyval) {}
04746
04748
04752 const_ipair equal_range(const key_type& keyval) const {}
04753 };
04754
04756
04761 template <int X, class CT, class Pr>
04762 bool operator==(const XMultiSkipList<X,CT,Pr> &left, const XMultiSkipList<X,CT,Pr> &right)
04763 {
04764 return ((left.size() == right.size()) &&
04765 (std::equal(left.begin(), left.end(), right.begin())));
04766 }
04767
04769
04774 template <int X, class CT, class Pr>
04775 bool operator!=(const XMultiSkipList<X,CT,Pr> &left, const XMultiSkipList<X,CT,Pr> &right)
04776 {
04777 return !(left==right);
04778 }
04779
04781
04786 template <int X, class CT, class Pr>
04787 bool operator<(const XMultiSkipList<X,CT,Pr> &left, const XMultiSkipList<X,CT,Pr> &right)
04788 {
04789 return lexicographical_compare(left.begin(),left.end(),right.begin(),right.end(),left.value_comp());
04790 }
04791
04793
04798 template <int X, class CT, class Pr>
04799 bool operator<=(const XMultiSkipList<X,CT,Pr> &left, const XMultiSkipList<X,CT,Pr> &right)
04800 {
04801 return !(right < left);
04802 }
04803
04805
04810 template <int X, class CT, class Pr>
04811 bool operator>(const XMultiSkipList<X,CT,Pr> &left, const XMultiSkipList<X,CT,Pr> &right)
04812 {
04813 return (right < left);
04814 }
04815
04817
04822 template <int X, class CT, class Pr>
04823 bool operator>=(const XMultiSkipList<X,CT,Pr> &left, const XMultiSkipList<X,CT,Pr> &right)
04824 {
04825 return !(left < right);
04826 }
04827
04829
04841 template <unsigned int X, class K, class CT, class A=XAccessSelf<K,typename CT::value_type>, class Pr = std::less<K> >
04842 class XMultiAccessSkipList : public XList<typename CT::value_type, typename CT::node_type>
04843 {
04844 public:
04846 typedef size_t size_type;
04848
04851 typedef ptrdiff_t difference_type;
04853 typedef XMultiAccessSkipList<X,K,CT,A,Pr> container_type;
04854
04856 typedef YIterator0<X,container_type> T0;
04858 typedef YIterator1<X,container_type> T1;
04859
04860 friend class YIterator0<X,container_type>;
04861 friend class YIterator1<X,container_type>;
04862
04864
04869 typedef T0 iterator;
04871 typedef T1 const_iterator;
04872
04874
04877 typedef typename CT::value_type value_type;
04878 typedef value_type T;
04880 typedef value_type key_type;
04882 typedef value_type mapped_type;
04884 typedef value_type& mapped_type_reference;
04886 typedef const value_type const_mapped_type;
04888 typedef const value_type& const_mapped_type_reference;
04890 typedef typename CT::node_type node_type;
04892 typedef value_type* pointer;
04894 typedef value_type& reference;
04896 typedef const value_type& const_reference;
04898
04901 typedef std::reverse_iterator<iterator> reverse_iterator;
04903 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
04905 typedef typename CT::data_type data_type;
04906
04908 typedef std::pair<iterator, iterator> ipair;
04910 typedef std::pair<const_iterator, const_iterator> const_ipair;
04911
04913 typedef Pr key_compare;
04914
04916 class value_compare
04917 : public std::binary_function<value_type, value_type, bool>
04918 {
04919 friend class MultiAccessSkipList<K,T,A,Pr,R>;
04920 public:
04921 bool operator()(const value_type& left, const value_type& right) const
04922 {return (comp(a(left), a(right))); }
04923 protected:
04924 value_compare(const key_compare &pr) : comp(pr) {}
04925 key_compare comp;
04926 A a;
04927 };
04928
04929 private:
04930 data_type *data;
04931 A a;
04932 key_compare KeyCompare;
04933 value_compare ValueCompare;
04934
04936
04945 void scan(const iterator &where) const {}
04946
04948
04957 void scanAll(const iterator &where) const {}
04958
04960
04968 void scan(node_type *nodex) {}
04969
04971
04979 void scanAll(node_type *nodex) {}
04980
04982
04990 void scan_val(const value_type &val) const {}
04991
04993
05001 void scanAll_val(const value_type &val) const {}
05002
05004
05012 void scan_val(const key_type &val) const {}
05013
05015
05023 void scanAll_key(const key_type &val) const {}
05024
05026 size_type& getItems() {}
05028
05031 void setItems(const size_type sz) {}
05032
05034 std::pair<size_type,node_type*>* getUpdate() {}
05035
05037 size_type getScanIndex() const {}
05038
05040
05043 void setScanIndex(const size_type sz) {}
05044
05046 typedef std::pair<size_type,node_type*>* pair_t;
05047
05048 public:
05050 XMultiAccessSkipList() {}
05051
05053 ~XMultiAccessSkipList() {}
05054
05056
05063 void setData(void *data) {}
05064
05066 data_type* getData() {}
05067
05069
05075 container_type& operator=(const container_type &source) {}
05076
05078
05081 iterator begin(){}
05082
05084
05087 iterator end(){}
05088
05090
05093 const_iterator begin() const{}
05094
05096
05099 const_iterator end() const{}
05100
05102
05105 reverse_iterator rbegin(){}
05106
05108
05111 reverse_iterator rend(){}
05112
05114
05117 const_reverse_iterator rbegin() const{}
05118
05120
05123 const_reverse_iterator rend() const{}
05124
05126
05129 size_type size() const{}
05130
05132
05135 bool empty() const{}
05136
05138
05141 reference front(){}
05142
05144
05147 const_reference front() const{}
05148
05150
05153 reference back(){}
05154
05156
05159 const_reference back() const{}
05160
05162 void pop_front(){}
05163
05165 void destroy_front(){}
05166
05168 void pop_back(){}
05169
05171 void destroy_back(){}
05172
05174
05181 template<class InIt> void assign(InIt first, InIt last){}
05182
05184
05188 iterator insert(const value_type& val){}
05189
05191
05197 iterator insert(const iterator &where, const value_type& val) {}
05198
05200
05204 template<class InIt> void insert(InIt first, InIt last) {}
05205
05207
05211 iterator erase(const iterator &where){}
05212
05214
05218 iterator destroy(const iterator &where){}
05219
05221
05228 iterator erase(const iterator &first, const iterator &last){}
05229
05231
05238 iterator destroy(const iterator &first, const iterator &last){}
05239
05241
05245 size_type erase(const key_type &keyval){}
05246
05248
05252 size_type destroy(const key_type &keyval){}
05253
05255 void clear(){}
05256
05258 void destroy(){}
05259
05261
05264 void swap(container_type& right) {}
05265
05267
05273 template<class Pr1> void erase_if(Pr1 pred);
05274
05276
05282 template<class Pr4> void destroy_if(Pr4 pred);
05283
05285
05291 void unique(){}
05292
05294
05302 template<class Pr2> void unique(Pr2 pred){}
05303
05305 key_compare key_comp() const { }
05306
05308 value_compare value_comp() const { }
05309
05311 size_type max_size() const{}
05312
05314
05321 const key_type& key(const value_type& value) const {}
05322
05324
05331 mapped_type_reference value(reference value) const {}
05332
05334
05341 const_mapped_type_reference value(const_reference value) const {return value;}
05342
05344
05348 iterator find(const key_type& keyval) {}
05349
05351
05355 const_iterator find(const key_type& keyval) const {}
05356
05358
05362 size_type count(const key_type& keyval) const {}
05363
05365
05369 iterator lower_bound(const key_type& keyval) {}
05370
05372
05376 const_iterator lower_bound(const key_type& keyval) const {}
05377
05379
05383 iterator upper_bound(const key_type& keyval) {}
05384
05386
05390 const_iterator upper_bound(const key_type& keyval) const {}
05391
05393
05397 ipair equal_range(const key_type& keyval) {}
05398
05400
05404 const_ipair equal_range(const key_type& keyval) const {}
05405 };
05406
05408
05413 template <unsigned int X, class K, class CT, class A, class Pr>
05414 bool operator==(const XMultiAcessSkipList<X,K,CT,A,Pr> &left, const XMultiAcessSkipList<X,K,CT,A,Pr> &right)
05415 {
05416 return ((left.size() == right.size()) &&
05417 (std::equal(left.begin(), left.end(), right.begin())));
05418 }
05419
05421
05426 template <unsigned int X, class K, class CT, class A, class Pr>
05427 bool operator!=(const XMultiAcessSkipList<X,K,CT,A,Pr> &left, const XMultiAcessSkipList<X,K,CT,A,Pr> &right)
05428 {
05429 return !(left==right);
05430 }
05431
05433
05438 template <unsigned int X, class K, class CT, class A, class Pr>
05439 bool operator<(const XMultiAcessSkipList<X,K,CT,A,Pr> &left, const XMultiAcessSkipList<X,K,CT,A,Pr> &right)
05440 {
05441 return lexicographical_compare(left.begin(),left.end(),right.begin(),right.end(),left.value_comp());
05442 }
05443
05445
05450 template <unsigned int X, class K, class CT, class A, class Pr>
05451 bool operator<=(const XMultiAcessSkipList<X,K,CT,A,Pr> &left, const XMultiAcessSkipList<X,K,CT,A,Pr> &right)
05452 {
05453 return !(right < left);
05454 }
05455
05457
05462 template <unsigned int X, class K, class CT, class A, class Pr>
05463 bool operator>(const XMultiAcessSkipList<X,K,CT,A,Pr> &left, const XMultiAcessSkipList<X,K,CT,A,Pr> &right)
05464 {
05465 return (right < left);
05466 }
05467
05469
05474 template <unsigned int X, class K, class CT, class A, class Pr>
05475 bool operator>=(const XMultiAcessSkipList<X,K,CT,A,Pr> &left, const XMultiAcessSkipList<X,K,CT,A,Pr> &right)
05476 {
05477 return !(left < right);
05478 }
05479
05480
05481
05483
05495 template<unsigned int X, class container_type>
05496 void iter_swap(CS::XIterator0<X,container_type> left, CS::XIterator0<X,container_type> right) {}
05497
05499
05509 template<unsigned int X, class container_type>
05510 void reverse(CS::XIterator0<X,container_type> first, CS::XIterator0<X,container_type> last) {}
05511
05513
05524 template<unsigned int X, class container_type>
05525 void quick_sort(CS::XIterator0<X,container_type> first, CS::XIterator0<X,container_type> last) {}
05526
05528
05536 template <class T, class Pr>
05537 class XDerefT : std::binary_function<T, T, bool>
05538 {
05539 private:
05540 Pr pred;
05541 XDerefT() {}
05542 public:
05544
05550 XDerefT(const Pr &pred) : pred(pred) {}
05551
05553
05558 bool operator()(const T &a, const T &b) const { return pred(a->object,b->object); }
05559 };
05560
05562
05576 template<unsigned int X, class container_type, class Pr>
05577 void insert_sort_N(const CS::XIterator0<X,container_type> &first, const CS::XIterator0<X,container_type> &last, const Pr &pred) {}
05578
05579
05581
05594 template<unsigned int X, class container_type, class Pr>
05595 void insert_sort(const CS::XIterator0<X,container_type> &first, const CS::XIterator0<X,container_type> &last, const Pr &pred) {}
05596
05598
05612 template<unsigned int X, class container_type>
05613 void insert_sort(const CS::XIterator0<X,container_type> &first, const CS::XIterator0<X,container_type> &last) {}
05614
05616
05620 template <class T, class Pr>
05621 class LessEqualT : std::binary_function<T, T, bool>
05622 {
05623 private:
05624 Pr pred;
05625 LessEqualT() {}
05626 public:
05628
05631 LessEqualT(const Pr &pred) : pred(pred) {}
05633
05638 bool operator()(const T &a, const T &b) const { return (!pred(b,a)); }
05639 };
05640
05642
05655 template<unsigned int X, class container_type, class Pr>
05656 void merge_sort(CS::XIterator0<X,container_type> &first, CS::XIterator0<X,container_type> &last, const Pr &pred) {}
05657
05659
05672 template<unsigned int X, class container_type>
05673 void merge_sort(CS::XIterator0<X,container_type> &first, CS::XIterator0<X,container_type> &last) {}
05674
05676
05691 template<unsigned int X, class container_type, class Pr>
05692 void sort(CS::XIterator0<X,container_type> first, CS::XIterator0<X,container_type> last, const Pr pred) {}
05693
05695
05710 template<unsigned int X, class container_type, class Pr>
05711 void stable_sort(CS::XIterator0<X,container_type> first, CS::XIterator0<X,container_type> last, const Pr pred) {}
05712
05714
05728 template<unsigned int X, class container_type>
05729 void sort(CS::XIterator0<X,container_type> first, CS::XIterator0<X,container_type> last) {}
05730
05732
05747 template<unsigned int X, class container_type>
05748 void stable_sort(CS::XIterator0<X,container_type> first, CS::XIterator0<X,container_type> last) {}
05749
05750
05751
05752