| williamr@2 |      1 | /*
 | 
| williamr@2 |      2 |  * Copyright (c) 1999, 2000
 | 
| williamr@2 |      3 |  * Boris Fomitchev
 | 
| williamr@2 |      4 |  *
 | 
| williamr@2 |      5 |  * This material is provided "as is", with absolutely no warranty expressed
 | 
| williamr@2 |      6 |  * or implied. Any use is at your own risk.
 | 
| williamr@2 |      7 |  *
 | 
| williamr@2 |      8 |  * Permission to use or copy this software for any purpose is hereby granted 
 | 
| williamr@2 |      9 |  * without fee, provided the above notices are retained on all copies.
 | 
| williamr@2 |     10 |  * Permission to modify the code and to distribute modified code is granted,
 | 
| williamr@2 |     11 |  * provided the above notices are retained, and a notice that the code was
 | 
| williamr@2 |     12 |  * modified is included with the above copyright notice.
 | 
| williamr@2 |     13 |  *
 | 
| williamr@2 |     14 |  */
 | 
| williamr@2 |     15 | 
 | 
| williamr@2 |     16 | /* NOTE: This is an internal header file, included by other STL headers.
 | 
| williamr@2 |     17 |  *   You should not attempt to use it directly.
 | 
| williamr@2 |     18 |  */
 | 
| williamr@2 |     19 | 
 | 
| williamr@2 |     20 | #ifndef _STLP_INTERNAL_WRAP_SET_H
 | 
| williamr@2 |     21 | #define _STLP_INTERNAL_WRAP_SET_H
 | 
| williamr@2 |     22 | 
 | 
| williamr@2 |     23 | #ifndef _STLP_INTERNAL_SET_H
 | 
| williamr@2 |     24 | # include <stl/_set.h>
 | 
| williamr@2 |     25 | #endif
 | 
| williamr@2 |     26 | 
 | 
| williamr@2 |     27 | # ifdef _STLP_USE_NAMESPACES
 | 
| williamr@2 |     28 | namespace STLPORT { 
 | 
| williamr@2 |     29 | # endif
 | 
| williamr@2 |     30 | 
 | 
| williamr@2 |     31 | #  if defined (_STLP_MINIMUM_DEFAULT_TEMPLATE_PARAMS)
 | 
| williamr@2 |     32 | #   define __SET_TEMPLATE_HEADER  template <class _Key>
 | 
| williamr@2 |     33 | #   define __SET_ARGUMENTS        _Key
 | 
| williamr@2 |     34 | #   define __MSET_TEMPLATE_HEADER  template <class _Key>
 | 
| williamr@2 |     35 | #   define __MSET_ARGUMENTS        _Key
 | 
| williamr@2 |     36 | #   define _Compare less<_Key>
 | 
| williamr@2 |     37 | #  else
 | 
| williamr@2 |     38 | #   define __SET_TEMPLATE_HEADER  template <class _Key, class _Compare >
 | 
| williamr@2 |     39 | #   define __SET_ARGUMENTS        _Key, _Compare
 | 
| williamr@2 |     40 | #   define __MSET_TEMPLATE_HEADER  template <class _Key, class _Compare >
 | 
| williamr@2 |     41 | #   define __MSET_ARGUMENTS        _Key, _Compare
 | 
| williamr@2 |     42 | #  endif
 | 
| williamr@2 |     43 | 
 | 
| williamr@2 |     44 | #   define __SET_SUPER  __set< _Key, _Compare, _STLP_DEFAULT_ALLOCATOR(_Key) >
 | 
| williamr@2 |     45 | #   define __MSET_SUPER __multiset< _Key, _Compare, _STLP_DEFAULT_ALLOCATOR(_Key) >
 | 
| williamr@2 |     46 | 
 | 
| williamr@2 |     47 | // provide a "default" set adaptor
 | 
| williamr@2 |     48 | __SET_TEMPLATE_HEADER
 | 
| williamr@2 |     49 | class set : public __SET_SUPER
 | 
| williamr@2 |     50 | {
 | 
| williamr@2 |     51 |   typedef set< __SET_ARGUMENTS > _Self;
 | 
| williamr@2 |     52 | public:
 | 
| williamr@2 |     53 |     typedef __SET_SUPER _Super;
 | 
| williamr@2 |     54 |     __IMPORT_WITH_REVERSE_ITERATORS(_Super)
 | 
| williamr@2 |     55 |     // copy & assignment from super
 | 
| williamr@2 |     56 |     __IMPORT_SUPER_COPY_ASSIGNMENT(set,_Self,__SET_SUPER)
 | 
| williamr@2 |     57 |     // specific constructors
 | 
| williamr@2 |     58 |     explicit set() : __SET_SUPER(_Compare()) {}
 | 
| williamr@2 |     59 |     explicit set(const _Compare& __comp) : __SET_SUPER(__comp) {}
 | 
| williamr@2 |     60 |     set(const value_type* __first, const value_type* __last) : 
 | 
| williamr@2 |     61 |         __SET_SUPER(__first, __last, _Compare()) { }
 | 
| williamr@2 |     62 |     set(const value_type* __first, const value_type* __last, 
 | 
| williamr@2 |     63 |         const _Compare& __comp) : __SET_SUPER(__first, __last, __comp) { }
 | 
| williamr@2 |     64 |     set(const_iterator __first, const_iterator __last) : 
 | 
| williamr@2 |     65 |         __SET_SUPER(__first, __last, _Compare()) { }
 | 
| williamr@2 |     66 |     set(const_iterator __first, const_iterator __last, 
 | 
| williamr@2 |     67 |         const _Compare& __comp) : __SET_SUPER(__first, __last, __comp) { }
 | 
| williamr@2 |     68 | };
 | 
| williamr@2 |     69 | 
 | 
| williamr@2 |     70 | #  if defined (_STLP_BASE_MATCH_BUG)
 | 
| williamr@2 |     71 | __SET_TEMPLATE_HEADER 
 | 
| williamr@2 |     72 | inline bool operator==(const set< __SET_ARGUMENTS >& __x, 
 | 
| williamr@2 |     73 |                        const set< __SET_ARGUMENTS >& __y) {
 | 
| williamr@2 |     74 |   typedef __SET_SUPER _Super;
 | 
| williamr@2 |     75 |   return operator==((const _Super&)__x,(const _Super&)__y);
 | 
| williamr@2 |     76 | }
 | 
| williamr@2 |     77 | 
 | 
| williamr@2 |     78 | __SET_TEMPLATE_HEADER 
 | 
| williamr@2 |     79 | inline bool operator<(const set< __SET_ARGUMENTS >& __x, 
 | 
| williamr@2 |     80 |                       const set< __SET_ARGUMENTS >& __y) {
 | 
| williamr@2 |     81 |   typedef __SET_SUPER _Super;
 | 
| williamr@2 |     82 |   return operator < ((const _Super&)__x , (const _Super&)__y);
 | 
| williamr@2 |     83 | }
 | 
| williamr@2 |     84 | #  endif
 | 
| williamr@2 |     85 | 
 | 
| williamr@2 |     86 | // provide a "default" multiset adaptor
 | 
| williamr@2 |     87 | __MSET_TEMPLATE_HEADER 
 | 
| williamr@2 |     88 | class multiset : public __MSET_SUPER
 | 
| williamr@2 |     89 | {
 | 
| williamr@2 |     90 |     typedef multiset< __MSET_ARGUMENTS > _Self;
 | 
| williamr@2 |     91 | public:
 | 
| williamr@2 |     92 |     typedef __MSET_SUPER _Super;
 | 
| williamr@2 |     93 |     __IMPORT_WITH_REVERSE_ITERATORS(_Super)
 | 
| williamr@2 |     94 |     // copy & assignment from super
 | 
| williamr@2 |     95 |     __IMPORT_SUPER_COPY_ASSIGNMENT(multiset, _Self, __MSET_SUPER)
 | 
| williamr@2 |     96 |     explicit multiset() : __MSET_SUPER(_Compare()) {}
 | 
| williamr@2 |     97 |     explicit multiset(const _Compare& __comp) : __MSET_SUPER(__comp) {}
 | 
| williamr@2 |     98 |     multiset(const value_type* __first, const value_type* __last) : 
 | 
| williamr@2 |     99 |         __MSET_SUPER(__first, __last, _Compare()) { }
 | 
| williamr@2 |    100 |     multiset(const value_type* __first, const value_type* __last, 
 | 
| williamr@2 |    101 |         const _Compare& __comp) : __MSET_SUPER(__first, __last, __comp) { }
 | 
| williamr@2 |    102 |     multiset(const_iterator __first, const_iterator __last) : 
 | 
| williamr@2 |    103 |         __MSET_SUPER(__first, __last, _Compare()) { }
 | 
| williamr@2 |    104 |     multiset(const_iterator __first, const_iterator __last, 
 | 
| williamr@2 |    105 |         const _Compare& __comp) : __MSET_SUPER(__first, __last, __comp) { }
 | 
| williamr@2 |    106 | };
 | 
| williamr@2 |    107 | 
 | 
| williamr@2 |    108 | #  if defined (_STLP_BASE_MATCH_BUG)   
 | 
| williamr@2 |    109 | __MSET_TEMPLATE_HEADER 
 | 
| williamr@2 |    110 | inline bool operator==(const multiset< __MSET_ARGUMENTS >& __x, 
 | 
| williamr@2 |    111 |                        const multiset< __MSET_ARGUMENTS >& __y) {
 | 
| williamr@2 |    112 |   typedef __MSET_SUPER  _Super;
 | 
| williamr@2 |    113 |   return (const _Super&)__x == (const _Super&)__y;
 | 
| williamr@2 |    114 | }
 | 
| williamr@2 |    115 | 
 | 
| williamr@2 |    116 | __MSET_TEMPLATE_HEADER 
 | 
| williamr@2 |    117 | inline bool operator<(const multiset< __MSET_ARGUMENTS >& __x, 
 | 
| williamr@2 |    118 |                       const multiset< __MSET_ARGUMENTS >& __y) {
 | 
| williamr@2 |    119 |   typedef __MSET_SUPER _Super;
 | 
| williamr@2 |    120 |   return (const _Super&)__x < (const _Super&)__y;
 | 
| williamr@2 |    121 | }
 | 
| williamr@2 |    122 | #  endif
 | 
| williamr@2 |    123 | 
 | 
| williamr@2 |    124 | # undef __MSET_TEMPLATE_HEADER
 | 
| williamr@2 |    125 | # undef __MSET_ARGUMENTS
 | 
| williamr@2 |    126 | # undef __MSET_SUPER
 | 
| williamr@2 |    127 | 
 | 
| williamr@2 |    128 | # undef __SET_TEMPLATE_HEADER
 | 
| williamr@2 |    129 | # undef __SET_ARGUMENTS
 | 
| williamr@2 |    130 | # undef __SET_SUPER 
 | 
| williamr@2 |    131 | # undef _Compare
 | 
| williamr@2 |    132 | 
 | 
| williamr@2 |    133 | # ifdef _STLP_USE_NAMESPACES
 | 
| williamr@2 |    134 | } /* namespace STLPORT */
 | 
| williamr@2 |    135 | # endif
 | 
| williamr@2 |    136 | 
 | 
| williamr@2 |    137 | #endif /* _STLP_INTERNAL_WRAP_SET_H */
 | 
| williamr@2 |    138 | 
 | 
| williamr@2 |    139 | // Local Variables:
 | 
| williamr@2 |    140 | // mode:C++
 | 
| williamr@2 |    141 | // End:
 |