Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

set Class Template Reference

#include <stl_set.h>

Collaboration diagram for set:

Collaboration graph
[legend]
List of all members.

Public Types

typedef Key key_type
typedef Key value_type
typedef Compare key_compare
typedef Compare value_compare
typedef rep_type::const_pointer pointer
typedef rep_type::const_pointer const_pointer
typedef rep_type::const_reference reference
typedef rep_type::const_reference const_reference
typedef rep_type::const_iterator iterator
typedef rep_type::const_iterator const_iterator
typedef rep_type::const_reverse_iterator reverse_iterator
typedef rep_type::const_reverse_iterator const_reverse_iterator
typedef rep_type::size_type size_type
typedef rep_type::difference_type difference_type
typedef pair< iterator, bool > pair_iterator_bool

Public Methods

 set ()
 set (const Compare &comp)
 set (const value_type *first, const value_type *last)
 set (const value_type *first, const value_type *last, const Compare &comp)
 set (const_iterator first, const_iterator last)
 set (const_iterator first, const_iterator last, const Compare &comp)
 set (const set< Key, Compare, Alloc > &x)
set< Key, Compare, Alloc > & operator= (const set< Key, Compare, Alloc > &x)
key_compare key_comp () const
value_compare value_comp () const
iterator begin () const
iterator end () const
reverse_iterator rbegin () const
reverse_iterator rend () const
bool empty () const
size_type size () const
size_type max_size () const
void swap (set< Key, Compare, Alloc > &x)
pair< iterator, bool > insert (const value_type &x)
iterator insert (iterator position, const value_type &x)
void insert (const_iterator first, const_iterator last)
void insert (const value_type *first, const value_type *last)
void erase (iterator position)
size_type erase (const key_type &x)
void erase (iterator first, iterator last)
void clear ()
iterator find (const key_type &x) const
size_type count (const key_type &x) const
iterator lower_bound (const key_type &x) const
iterator upper_bound (const key_type &x) const
pair< iterator, iteratorequal_range (const key_type &x) const

Private Types

typedef rb_tree< key_type,
value_type, identity< value_type >,
key_compare, Alloc > 
rep_type

Private Attributes

rep_type t

Friends

bool operator==__STL_NULL_TMPL_ARGS (const set &, const set &)
bool operator<__STL_NULL_TMPL_ARGS (const set &, const set &)

template<class Key, class Compare = less<Key>, class Alloc = alloc>
class set< Key, Compare, Alloc >


Member Typedef Documentation

template<class Key, class Compare = less<Key>, class Alloc = alloc>
typedef rep_type::const_iterator set::const_iterator
 

Definition at line 63 of file stl_set.h.

Referenced by insert, and set.

template<class Key, class Compare = less<Key>, class Alloc = alloc>
typedef rep_type::const_pointer set::const_pointer
 

Definition at line 59 of file stl_set.h.

template<class Key, class Compare = less<Key>, class Alloc = alloc>
typedef rep_type::const_reference set::const_reference
 

Definition at line 61 of file stl_set.h.

template<class Key, class Compare = less<Key>, class Alloc = alloc>
typedef rep_type::const_reverse_iterator set::const_reverse_iterator
 

Definition at line 65 of file stl_set.h.

template<class Key, class Compare = less<Key>, class Alloc = alloc>
typedef rep_type::difference_type set::difference_type
 

Definition at line 67 of file stl_set.h.

template<class Key, class Compare = less<Key>, class Alloc = alloc>
typedef rep_type::const_iterator set::iterator
 

Definition at line 62 of file stl_set.h.

Referenced by begin, end, erase, find, insert, lower_bound, and upper_bound.

template<class Key, class Compare = less<Key>, class Alloc = alloc>
typedef Compare set::key_compare
 

Definition at line 51 of file stl_set.h.

template<class Key, class Compare = less<Key>, class Alloc = alloc>
typedef Key set::key_type
 

Definition at line 49 of file stl_set.h.

template<class Key, class Compare = less<Key>, class Alloc = alloc>
typedef pair<iterator, bool> set::pair_iterator_bool
 

Definition at line 114 of file stl_set.h.

template<class Key, class Compare = less<Key>, class Alloc = alloc>
typedef rep_type::const_pointer set::pointer
 

Definition at line 58 of file stl_set.h.

template<class Key, class Compare = less<Key>, class Alloc = alloc>
typedef rep_type::const_reference set::reference
 

Definition at line 60 of file stl_set.h.

template<class Key, class Compare = less<Key>, class Alloc = alloc>
typedef rb_tree<key_type, value_type, identity<value_type>, key_compare, Alloc> set::rep_type [private]
 

Definition at line 55 of file stl_set.h.

template<class Key, class Compare = less<Key>, class Alloc = alloc>
typedef rep_type::const_reverse_iterator set::reverse_iterator
 

Definition at line 64 of file stl_set.h.

Referenced by rbegin, and rend.

template<class Key, class Compare = less<Key>, class Alloc = alloc>
typedef rep_type::size_type set::size_type
 

Definition at line 66 of file stl_set.h.

Referenced by count, erase, max_size, and size.

template<class Key, class Compare = less<Key>, class Alloc = alloc>
typedef Compare set::value_compare
 

Definition at line 52 of file stl_set.h.

Referenced by value_comp.

template<class Key, class Compare = less<Key>, class Alloc = alloc>
typedef Key set::value_type
 

Definition at line 50 of file stl_set.h.


Constructor & Destructor Documentation

template<class Key, class Compare = less<Key>, class Alloc = alloc>
set< Key, Compare, Alloc >::set   [inline]
 

Definition at line 71 of file stl_set.h.

00071 : t(Compare()) {}

template<class Key, class Compare = less<Key>, class Alloc = alloc>
set< Key, Compare, Alloc >::set const Compare &    comp [inline, explicit]
 

Definition at line 72 of file stl_set.h.

00072 : t(comp) {}

template<class Key, class Compare = less<Key>, class Alloc = alloc>
set< Key, Compare, Alloc >::set const value_type   first,
const value_type   last
[inline]
 

Definition at line 83 of file stl_set.h.

References rb_tree< key_type, value_type, identity< value_type >, key_compare, Alloc >::insert_unique.

00084     : t(Compare()) { t.insert_unique(first, last); }

template<class Key, class Compare = less<Key>, class Alloc = alloc>
set< Key, Compare, Alloc >::set const value_type   first,
const value_type   last,
const Compare &    comp
[inline]
 

Definition at line 85 of file stl_set.h.

References rb_tree< key_type, value_type, identity< value_type >, key_compare, Alloc >::insert_unique.

00086     : t(comp) { t.insert_unique(first, last); }

template<class Key, class Compare = less<Key>, class Alloc = alloc>
set< Key, Compare, Alloc >::set const_iterator    first,
const_iterator    last
[inline]
 

Definition at line 88 of file stl_set.h.

References const_iterator, and rb_tree< key_type, value_type, identity< value_type >, key_compare, Alloc >::insert_unique.

00089     : t(Compare()) { t.insert_unique(first, last); }

template<class Key, class Compare = less<Key>, class Alloc = alloc>
set< Key, Compare, Alloc >::set const_iterator    first,
const_iterator    last,
const Compare &    comp
[inline]
 

Definition at line 90 of file stl_set.h.

References const_iterator, and rb_tree< key_type, value_type, identity< value_type >, key_compare, Alloc >::insert_unique.

00091     : t(comp) { t.insert_unique(first, last); }

template<class Key, class Compare = less<Key>, class Alloc = alloc>
set< Key, Compare, Alloc >::set const set< Key, Compare, Alloc > &    x [inline]
 

Definition at line 94 of file stl_set.h.

00094 : t(x.t) {}


Member Function Documentation

template<class Key, class Compare = less<Key>, class Alloc = alloc>
iterator set< Key, Compare, Alloc >::begin   const [inline]
 

Definition at line 104 of file stl_set.h.

References rb_tree< key_type, value_type, identity< value_type >, key_compare, Alloc >::begin, and iterator.

00104 { return t.begin(); }

template<class Key, class Compare = less<Key>, class Alloc = alloc>
void set< Key, Compare, Alloc >::clear   [inline]
 

Definition at line 147 of file stl_set.h.

References rb_tree< key_type, value_type, identity< value_type >, key_compare, Alloc >::clear.

00147 { t.clear(); }

template<class Key, class Compare = less<Key>, class Alloc = alloc>
size_type set< Key, Compare, Alloc >::count const key_type   x const [inline]
 

Definition at line 152 of file stl_set.h.

References rb_tree< key_type, value_type, identity< value_type >, key_compare, Alloc >::count, and size_type.

00152 { return t.count(x); }

template<class Key, class Compare = less<Key>, class Alloc = alloc>
bool set< Key, Compare, Alloc >::empty   const [inline]
 

Definition at line 108 of file stl_set.h.

References rb_tree< key_type, value_type, identity< value_type >, key_compare, Alloc >::empty.

00108 { return t.empty(); }

template<class Key, class Compare = less<Key>, class Alloc = alloc>
iterator set< Key, Compare, Alloc >::end   const [inline]
 

Definition at line 105 of file stl_set.h.

References rb_tree< key_type, value_type, identity< value_type >, key_compare, Alloc >::end, and iterator.

00105 { return t.end(); }

template<class Key, class Compare = less<Key>, class Alloc = alloc>
pair<iterator,iterator> set< Key, Compare, Alloc >::equal_range const key_type   x const [inline]
 

Definition at line 159 of file stl_set.h.

References rb_tree< key_type, value_type, identity< value_type >, key_compare, Alloc >::equal_range.

00159                                                                {
00160     return t.equal_range(x);
00161   }

template<class Key, class Compare = less<Key>, class Alloc = alloc>
void set< Key, Compare, Alloc >::erase iterator    first,
iterator    last
[inline]
 

Definition at line 143 of file stl_set.h.

References rb_tree< key_type, value_type, identity< value_type >, key_compare, Alloc >::erase, and iterator.

00143                                             { 
00144     typedef typename rep_type::iterator rep_iterator;
00145     t.erase((rep_iterator&)first, (rep_iterator&)last); 
00146   }

template<class Key, class Compare = less<Key>, class Alloc = alloc>
size_type set< Key, Compare, Alloc >::erase const key_type   x [inline]
 

Definition at line 140 of file stl_set.h.

References rb_tree< key_type, value_type, identity< value_type >, key_compare, Alloc >::erase, and size_type.

00140                                      { 
00141     return t.erase(x); 
00142   }

template<class Key, class Compare = less<Key>, class Alloc = alloc>
void set< Key, Compare, Alloc >::erase iterator    position [inline]
 

Definition at line 136 of file stl_set.h.

References rb_tree< key_type, value_type, identity< value_type >, key_compare, Alloc >::erase, and iterator.

00136                                 { 
00137     typedef typename rep_type::iterator rep_iterator;
00138     t.erase((rep_iterator&)position); 
00139   }

template<class Key, class Compare = less<Key>, class Alloc = alloc>
iterator set< Key, Compare, Alloc >::find const key_type   x const [inline]
 

Definition at line 151 of file stl_set.h.

References rb_tree< key_type, value_type, identity< value_type >, key_compare, Alloc >::find, and iterator.

00151 { return t.find(x); }

template<class Key, class Compare = less<Key>, class Alloc = alloc>
void set< Key, Compare, Alloc >::insert const value_type   first,
const value_type   last
[inline]
 

Definition at line 132 of file stl_set.h.

References rb_tree< key_type, value_type, identity< value_type >, key_compare, Alloc >::insert_unique.

00132                                                                {
00133     t.insert_unique(first, last);
00134   }

template<class Key, class Compare = less<Key>, class Alloc = alloc>
void set< Key, Compare, Alloc >::insert const_iterator    first,
const_iterator    last
[inline]
 

Definition at line 129 of file stl_set.h.

References const_iterator, and rb_tree< key_type, value_type, identity< value_type >, key_compare, Alloc >::insert_unique.

00129                                                          {
00130     t.insert_unique(first, last);
00131   }

template<class Key, class Compare = less<Key>, class Alloc = alloc>
iterator set< Key, Compare, Alloc >::insert iterator    position,
const value_type   x
[inline]
 

Definition at line 119 of file stl_set.h.

References rb_tree< key_type, value_type, identity< value_type >, key_compare, Alloc >::insert_unique, and iterator.

00119                                                           {
00120     typedef typename rep_type::iterator rep_iterator;
00121     return t.insert_unique((rep_iterator&)position, x);
00122   }

template<class Key, class Compare = less<Key>, class Alloc = alloc>
pair<iterator,bool> set< Key, Compare, Alloc >::insert const value_type   x [inline]
 

Definition at line 115 of file stl_set.h.

References pair::first, rb_tree< key_type, value_type, identity< value_type >, key_compare, Alloc >::insert_unique, and pair::second.

00115                                                   { 
00116     pair<typename rep_type::iterator, bool> p = t.insert_unique(x); 
00117     return pair<iterator, bool>(p.first, p.second);
00118   }

template<class Key, class Compare = less<Key>, class Alloc = alloc>
key_compare set< Key, Compare, Alloc >::key_comp   const [inline]
 

Definition at line 102 of file stl_set.h.

References rb_tree< key_type, value_type, identity< value_type >, key_compare, Alloc >::key_comp.

00102 { return t.key_comp(); }

template<class Key, class Compare = less<Key>, class Alloc = alloc>
iterator set< Key, Compare, Alloc >::lower_bound const key_type   x const [inline]
 

Definition at line 153 of file stl_set.h.

References iterator, and rb_tree< key_type, value_type, identity< value_type >, key_compare, Alloc >::lower_bound.

00153                                                 {
00154     return t.lower_bound(x);
00155   }

template<class Key, class Compare = less<Key>, class Alloc = alloc>
size_type set< Key, Compare, Alloc >::max_size   const [inline]
 

Definition at line 110 of file stl_set.h.

References rb_tree< key_type, value_type, identity< value_type >, key_compare, Alloc >::max_size, and size_type.

00110 { return t.max_size(); }

template<class Key, class Compare = less<Key>, class Alloc = alloc>
set<Key, Compare, Alloc>& set< Key, Compare, Alloc >::operator= const set< Key, Compare, Alloc > &    x [inline]
 

Definition at line 95 of file stl_set.h.

References t.

00095                                                                          { 
00096     t = x.t; 
00097     return *this;
00098   }

template<class Key, class Compare = less<Key>, class Alloc = alloc>
reverse_iterator set< Key, Compare, Alloc >::rbegin   const [inline]
 

Definition at line 106 of file stl_set.h.

References rb_tree< key_type, value_type, identity< value_type >, key_compare, Alloc >::rbegin, and reverse_iterator.

00106 { return t.rbegin(); } 

template<class Key, class Compare = less<Key>, class Alloc = alloc>
reverse_iterator set< Key, Compare, Alloc >::rend   const [inline]
 

Definition at line 107 of file stl_set.h.

References rb_tree< key_type, value_type, identity< value_type >, key_compare, Alloc >::rend, and reverse_iterator.

00107 { return t.rend(); }

template<class Key, class Compare = less<Key>, class Alloc = alloc>
size_type set< Key, Compare, Alloc >::size   const [inline]
 

Definition at line 109 of file stl_set.h.

References rb_tree< key_type, value_type, identity< value_type >, key_compare, Alloc >::size, and size_type.

00109 { return t.size(); }

template<class Key, class Compare = less<Key>, class Alloc = alloc>
void set< Key, Compare, Alloc >::swap set< Key, Compare, Alloc > &    x [inline]
 

Definition at line 111 of file stl_set.h.

References rb_tree< key_type, value_type, identity< value_type >, key_compare, Alloc >::swap, and t.

00111 { t.swap(x.t); }

template<class Key, class Compare = less<Key>, class Alloc = alloc>
iterator set< Key, Compare, Alloc >::upper_bound const key_type   x const [inline]
 

Definition at line 156 of file stl_set.h.

References iterator, and rb_tree< key_type, value_type, identity< value_type >, key_compare, Alloc >::upper_bound.

00156                                                 {
00157     return t.upper_bound(x); 
00158   }

template<class Key, class Compare = less<Key>, class Alloc = alloc>
value_compare set< Key, Compare, Alloc >::value_comp   const [inline]
 

Definition at line 103 of file stl_set.h.

References rb_tree< key_type, value_type, identity< value_type >, key_compare, Alloc >::key_comp, and value_compare.

00103 { return t.key_comp(); }


Friends And Related Function Documentation

template<class Key, class Compare = less<Key>, class Alloc = alloc>
bool operator<__STL_NULL_TMPL_ARGS const set< Key, Compare, Alloc > &   ,
const set< Key, Compare, Alloc > &   
[friend]
 

template<class Key, class Compare = less<Key>, class Alloc = alloc>
bool operator==__STL_NULL_TMPL_ARGS const set< Key, Compare, Alloc > &   ,
const set< Key, Compare, Alloc > &   
[friend]
 


Member Data Documentation

template<class Key, class Compare = less<Key>, class Alloc = alloc>
rep_type set::t [private]
 

Definition at line 56 of file stl_set.h.

Referenced by operator=, operator==, and swap.


The documentation for this class was generated from the following file:
logo OpenMask

Documentation generated on Thu May 2 15:03:44 2002

Generated with doxygen 1.2.12 by Dimitri van Heesch ,   1997-2001