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

ov_set< Key, Compare > Class Template Reference

A specialization of ordered_vector that emulates a standard STL set: one copy of each element is allowed. More...

#include <ordered_vector.h>

Inheritance diagram for ov_set< Key, Compare >:

ordered_vector< Key, Compare > List of all members.

Public Types

typedef TYPENAME ordered_vector<
Key, Compare >::iterator_0 
iterator_0
typedef TYPENAME ordered_vector<
Key, Compare >::value_type_0 
value_type_0
typedef Key key_type_0
typedef Key & reference_0
typedef const Key & const_reference_0
typedef Compare key_compare_0
typedef Compare value_compare_0
typedef TYPENAME Vector::const_iterator const_iterator_0
typedef TYPENAME Vector::reverse_iterator reverse_iterator_0
typedef TYPENAME Vector::const_reverse_iterator const_reverse_iterator_0
typedef TYPENAME Vector::difference_type difference_type_0
typedef TYPENAME Vector::size_type size_type_0
typedef key_type_0 key_type
typedef value_type_0 value_type
typedef reference_0 reference
typedef const_reference_0 const_reference
typedef key_compare_0 key_compare
typedef value_compare_0 value_compare
typedef iterator_0 iterator
typedef const_iterator_0 const_iterator
typedef reverse_iterator_0 reverse_iterator
typedef const_reverse_iterator_0 const_reverse_iterator
typedef difference_type_0 difference_type
typedef size_type_0 size_type

Public Member Functions

 ov_set (const Compare &compare=Compare())
 ov_set (const ov_set< Key, Compare > &copy)
ov_set< Key, Compare > & operator= (const ov_set< Key, Compare > &copy)
iterator_0 insert (iterator_0 position, const value_type_0 &key0)
pair< iterator_0, bool > insert (const value_type_0 &key0)
void sort ()
 Maps to sort_unique().

bool verify_list () const
 Maps to verify_list_unique().

iterator_0 begin ()
 Returns the iterator that marks the first element in the ordered vector.

const_iterator_0 begin () const
 Returns the iterator that marks the first element in the ordered vector.

iterator_0 end ()
 Returns the iterator that marks the end of the ordered vector.

const_iterator_0 end () const
 Returns the iterator that marks the end of the ordered vector.

reverse_iterator_0 rbegin ()
 Returns the iterator that marks the first element in the ordered vector, when viewed in reverse order.

const_reverse_iterator_0 rbegin () const
 Returns the iterator that marks the first element in the ordered vector, when viewed in reverse order.

reverse_iterator_0 rend ()
 Returns the iterator that marks the end of the ordered vector, when viewed in reverse order.

const_reverse_iterator_0 rend () const
 Returns the iterator that marks the end of the ordered vector, when viewed in reverse order.

reference operator[] (size_type_0 n)
const_reference operator[] (size_type_0 n) const
size_type_0 size () const
 Returns the number of elements in the ordered vector.

size_type_0 max_size () const
 Returns the maximum number of elements that can possibly be stored in an ordered vector.

bool empty () const
 Returns true if the ordered vector is empty, false otherwise.

bool operator== (const ordered_vector< Key, Compare > &other) const
 Returns true if the two ordered vectors are memberwise equivalent, false otherwise.

bool operator!= (const ordered_vector< Key, Compare > &other) const
 Returns true if the two ordered vectors are not memberwise equivalent, false if they are.

bool operator< (const ordered_vector< Key, Compare > &other) const
 Returns true if this ordered vector sorts lexicographically before the other one, false otherwise.

bool operator> (const ordered_vector< Key, Compare > &other) const
 Returns true if this ordered vector sorts lexicographically after the other one, false otherwise.

bool operator<= (const ordered_vector< Key, Compare > &other) const
 Returns true if this ordered vector sorts lexicographically before the other one or is equivalent, false otherwise.

bool operator>= (const ordered_vector< Key, Compare > &other) const
 Returns true if this ordered vector sorts lexicographically after the other one or is equivalent, false otherwise.

iterator_0 insert_unique (iterator_0 position, const value_type_0 &key)
pair< iterator_0, bool > insert_unique (const value_type_0 &key)
iterator_0 insert_nonunique (iterator_0 position, const value_type_0 &key)
iterator_0 insert_nonunique (const value_type_0 &key)
iterator_0 erase (iterator_0 position)
size_type_0 erase (const key_type_0 &key)
void erase (iterator_0 first, iterator_0 last)
void clear ()
 Removes all elements from the ordered vector.

iterator_0 find (const key_type_0 &key)
const_iterator_0 find (const key_type_0 &key) const
iterator_0 find_particular (const key_type_0 &key)
const_iterator_0 find_particular (const key_type_0 &key) const
size_type_0 count (const key_type_0 &key) const
iterator_0 lower_bound (const key_type_0 &key)
const_iterator_0 lower_bound (const key_type_0 &key) const
iterator_0 upper_bound (const key_type_0 &key)
const_iterator_0 upper_bound (const key_type_0 &key) const
pair< iterator_0, iterator_0equal_range (const key_type_0 &key)
pair< const_iterator_0, const_iterator_0equal_range (const key_type_0 &key) const
void swap (ordered_vector< Key, Compare > &other)
 Exchanges the contents of this vector and the other vector, in constant time (e.g., with a pointer swap).

void reserve (size_type_0 n)
void sort_unique ()
 Ensures that the vector is properly sorted after a potentially damaging operation.

void sort_nonunique ()
 Ensures that the vector is properly sorted after a potentially damaging operation.

bool verify_list_unique () const
bool verify_list_nonunique () const
void push_back (const value_type_0 &key)

Detailed Description

template<class Key, class Compare = less<Key>>
class ov_set< Key, Compare >

A specialization of ordered_vector that emulates a standard STL set: one copy of each element is allowed.

Definition at line 299 of file ordered_vector.h.


Member Typedef Documentation

template<class Key, class Compare = less<Key>>
typedef const_iterator_0 ordered_vector< Key, Compare >::const_iterator [inherited]
 

Definition at line 164 of file ordered_vector.h.

template<class Key, class Compare = less<Key>>
typedef TYPENAME Vector::const_iterator ordered_vector< Key, Compare >::const_iterator_0 [inherited]
 

Definition at line 147 of file ordered_vector.h.

template<class Key, class Compare = less<Key>>
typedef const_reference_0 ordered_vector< Key, Compare >::const_reference [inherited]
 

Definition at line 160 of file ordered_vector.h.

template<class Key, class Compare = less<Key>>
typedef const Key& ordered_vector< Key, Compare >::const_reference_0 [inherited]
 

Definition at line 139 of file ordered_vector.h.

template<class Key, class Compare = less<Key>>
typedef const_reverse_iterator_0 ordered_vector< Key, Compare >::const_reverse_iterator [inherited]
 

Definition at line 166 of file ordered_vector.h.

template<class Key, class Compare = less<Key>>
typedef TYPENAME Vector::const_reverse_iterator ordered_vector< Key, Compare >::const_reverse_iterator_0 [inherited]
 

Definition at line 149 of file ordered_vector.h.

template<class Key, class Compare = less<Key>>
typedef difference_type_0 ordered_vector< Key, Compare >::difference_type [inherited]
 

Definition at line 167 of file ordered_vector.h.

template<class Key, class Compare = less<Key>>
typedef TYPENAME Vector::difference_type ordered_vector< Key, Compare >::difference_type_0 [inherited]
 

Definition at line 151 of file ordered_vector.h.

template<class Key, class Compare = less<Key>>
typedef iterator_0 ordered_vector< Key, Compare >::iterator [inherited]
 

Definition at line 163 of file ordered_vector.h.

template<class Key, class Compare = less<Key>>
typedef TYPENAME ordered_vector<Key, Compare>:: iterator_0 ov_set< Key, Compare >::iterator_0
 

Reimplemented from ordered_vector< Key, Compare >.

Definition at line 301 of file ordered_vector.h.

template<class Key, class Compare = less<Key>>
typedef key_compare_0 ordered_vector< Key, Compare >::key_compare [inherited]
 

Definition at line 161 of file ordered_vector.h.

template<class Key, class Compare = less<Key>>
typedef Compare ordered_vector< Key, Compare >::key_compare_0 [inherited]
 

Definition at line 140 of file ordered_vector.h.

template<class Key, class Compare = less<Key>>
typedef key_type_0 ordered_vector< Key, Compare >::key_type [inherited]
 

Definition at line 157 of file ordered_vector.h.

template<class Key, class Compare = less<Key>>
typedef Key ordered_vector< Key, Compare >::key_type_0 [inherited]
 

Definition at line 136 of file ordered_vector.h.

template<class Key, class Compare = less<Key>>
typedef reference_0 ordered_vector< Key, Compare >::reference [inherited]
 

Definition at line 159 of file ordered_vector.h.

template<class Key, class Compare = less<Key>>
typedef Key& ordered_vector< Key, Compare >::reference_0 [inherited]
 

Definition at line 138 of file ordered_vector.h.

template<class Key, class Compare = less<Key>>
typedef reverse_iterator_0 ordered_vector< Key, Compare >::reverse_iterator [inherited]
 

Definition at line 165 of file ordered_vector.h.

template<class Key, class Compare = less<Key>>
typedef TYPENAME Vector::reverse_iterator ordered_vector< Key, Compare >::reverse_iterator_0 [inherited]
 

Definition at line 148 of file ordered_vector.h.

template<class Key, class Compare = less<Key>>
typedef size_type_0 ordered_vector< Key, Compare >::size_type [inherited]
 

Definition at line 168 of file ordered_vector.h.

template<class Key, class Compare = less<Key>>
typedef TYPENAME Vector::size_type ordered_vector< Key, Compare >::size_type_0 [inherited]
 

Definition at line 152 of file ordered_vector.h.

template<class Key, class Compare = less<Key>>
typedef value_compare_0 ordered_vector< Key, Compare >::value_compare [inherited]
 

Definition at line 162 of file ordered_vector.h.

template<class Key, class Compare = less<Key>>
typedef Compare ordered_vector< Key, Compare >::value_compare_0 [inherited]
 

Definition at line 141 of file ordered_vector.h.

template<class Key, class Compare = less<Key>>
typedef value_type_0 ordered_vector< Key, Compare >::value_type [inherited]
 

Definition at line 158 of file ordered_vector.h.

template<class Key, class Compare = less<Key>>
typedef TYPENAME ordered_vector<Key, Compare>:: value_type_0 ov_set< Key, Compare >::value_type_0
 

Reimplemented from ordered_vector< Key, Compare >.

Definition at line 302 of file ordered_vector.h.


Constructor & Destructor Documentation

template<class Key, class Compare>
ov_set< Key, Compare >::ov_set const Compare &  compare = Compare()  )  [inline]
 

Definition at line 910 of file ordered_vector.I.

template<class Key, class Compare>
ov_set< Key, Compare >::ov_set const ov_set< Key, Compare > &  copy  )  [inline]
 

Definition at line 925 of file ordered_vector.I.


Member Function Documentation

template<class Key, class Compare>
TYPENAME ordered_vector< Key, Compare >::CONST_ITERATOR ordered_vector< Key, Compare >::begin  )  const [inline, inherited]
 

Returns the iterator that marks the first element in the ordered vector.

Definition at line 159 of file ordered_vector.I.

References ordered_vector< Key, Compare >::_vector, INLINE, and TYPENAME.

template<class Key, class Compare>
TYPENAME ordered_vector< Key, Compare >::ITERATOR ordered_vector< Key, Compare >::begin  )  [inline, inherited]
 

Returns the iterator that marks the first element in the ordered vector.

Definition at line 95 of file ordered_vector.I.

References ordered_vector< Key, Compare >::_vector, INLINE, and TYPENAME.

Referenced by ordered_vector< Key, Compare >::clear(), ordered_vector< Key, Compare >::operator!=(), and ordered_vector< Key, Compare >::operator<().

template<class Key, class Compare>
void ordered_vector< Key, Compare >::clear  )  [inline, inherited]
 

Removes all elements from the ordered vector.

Definition at line 529 of file ordered_vector.I.

References ordered_vector< Key, Compare >::begin(), ordered_vector< Key, Compare >::end(), INLINE, ordered_vector< Key, Compare >::r_upper_bound(), and TYPENAME.

template<class Key, class Compare = less<Key>>
size_type_0 ordered_vector< Key, Compare >::count const key_type_0 key  )  const [inline, inherited]
 

Referenced by ordered_vector< Key, Compare >::operator<=().

template<class Key, class Compare>
bool ordered_vector< Key, Compare >::empty  )  const [inline, inherited]
 

Returns true if the ordered vector is empty, false otherwise.

Definition at line 281 of file ordered_vector.I.

References ordered_vector< Key, Compare >::_vector.

template<class Key, class Compare>
TYPENAME ordered_vector< Key, Compare >::CONST_ITERATOR ordered_vector< Key, Compare >::end  )  const [inline, inherited]
 

Returns the iterator that marks the end of the ordered vector.

Definition at line 175 of file ordered_vector.I.

References ordered_vector< Key, Compare >::_vector, INLINE, and TYPENAME.

template<class Key, class Compare>
TYPENAME ordered_vector< Key, Compare >::ITERATOR ordered_vector< Key, Compare >::end  )  [inline, inherited]
 

Returns the iterator that marks the end of the ordered vector.

Definition at line 111 of file ordered_vector.I.

References ordered_vector< Key, Compare >::_vector, INLINE, and TYPENAME.

Referenced by ordered_vector< Key, Compare >::clear(), ordered_vector< Key, Compare >::operator!=(), and ordered_vector< Key, Compare >::operator<().

template<class Key, class Compare = less<Key>>
pair< const_iterator_0 , const_iterator_0 > ordered_vector< Key, Compare >::equal_range const key_type_0 key  )  const [inline, inherited]
 

template<class Key, class Compare = less<Key>>
pair< iterator_0 , iterator_0 > ordered_vector< Key, Compare >::equal_range const key_type_0 key  )  [inline, inherited]
 

Referenced by ordered_vector< Key, Compare >::operator<=().

template<class Key, class Compare = less<Key>>
void ordered_vector< Key, Compare >::erase iterator_0  first,
iterator_0  last
[inline, inherited]
 

template<class Key, class Compare = less<Key>>
size_type_0 ordered_vector< Key, Compare >::erase const key_type_0 key  )  [inline, inherited]
 

template<class Key, class Compare = less<Key>>
iterator_0 ordered_vector< Key, Compare >::erase iterator_0  position  )  [inline, inherited]
 

Referenced by ordered_vector< Key, Compare >::operator<=().

template<class Key, class Compare = less<Key>>
const_iterator_0 ordered_vector< Key, Compare >::find const key_type_0 key  )  const [inline, inherited]
 

template<class Key, class Compare = less<Key>>
iterator_0 ordered_vector< Key, Compare >::find const key_type_0 key  )  [inline, inherited]
 

template<class Key, class Compare = less<Key>>
const_iterator_0 ordered_vector< Key, Compare >::find_particular const key_type_0 key  )  const [inline, inherited]
 

template<class Key, class Compare = less<Key>>
iterator_0 ordered_vector< Key, Compare >::find_particular const key_type_0 key  )  [inline, inherited]
 

template<class Key, class Compare = less<Key>>
pair< iterator_0 , bool> ov_set< Key, Compare >::insert const value_type_0 key0  )  [inline]
 

template<class Key, class Compare = less<Key>>
iterator_0 ov_set< Key, Compare >::insert iterator_0  position,
const value_type_0 key0
[inline]
 

template<class Key, class Compare = less<Key>>
iterator_0 ordered_vector< Key, Compare >::insert_nonunique const value_type_0 key  )  [inline, inherited]
 

template<class Key, class Compare = less<Key>>
iterator_0 ordered_vector< Key, Compare >::insert_nonunique iterator_0  position,
const value_type_0 key
[inherited]
 

template<class Key, class Compare = less<Key>>
pair< iterator_0 , bool> ordered_vector< Key, Compare >::insert_unique const value_type_0 key  )  [inline, inherited]
 

template<class Key, class Compare = less<Key>>
iterator_0 ordered_vector< Key, Compare >::insert_unique iterator_0  position,
const value_type_0 key
[inherited]
 

template<class Key, class Compare = less<Key>>
const_iterator_0 ordered_vector< Key, Compare >::lower_bound const key_type_0 key  )  const [inline, inherited]
 

template<class Key, class Compare = less<Key>>
iterator_0 ordered_vector< Key, Compare >::lower_bound const key_type_0 key  )  [inline, inherited]
 

template<class Key, class Compare>
TYPENAME ordered_vector< Key, Compare >::SIZE_TYPE ordered_vector< Key, Compare >::max_size  )  const [inline, inherited]
 

Returns the maximum number of elements that can possibly be stored in an ordered vector.

Definition at line 265 of file ordered_vector.I.

References ordered_vector< Key, Compare >::_vector, and INLINE.

template<class Key, class Compare>
bool ordered_vector< Key, Compare >::operator!= const ordered_vector< Key, Compare > &  other  )  const [inline, inherited]
 

Returns true if the two ordered vectors are not memberwise equivalent, false if they are.

Definition at line 313 of file ordered_vector.I.

References ordered_vector< Key, Compare >::_compare, ordered_vector< Key, Compare >::_vector, ordered_vector< Key, Compare >::begin(), ordered_vector< Key, Compare >::end(), ordered_vector< Key, Compare >::find_insert_position(), ITERATOR, and nassertr.

template<class Key, class Compare>
bool ordered_vector< Key, Compare >::operator< const ordered_vector< Key, Compare > &  other  )  const [inline, inherited]
 

Returns true if this ordered vector sorts lexicographically before the other one, false otherwise.

Definition at line 331 of file ordered_vector.I.

References ordered_vector< Key, Compare >::begin(), ordered_vector< Key, Compare >::end(), ordered_vector< Key, Compare >::find_insert_position(), INLINE, ITERATOR, nassertr, and TYPENAME.

template<class Key, class Compare>
bool ordered_vector< Key, Compare >::operator<= const ordered_vector< Key, Compare > &  other  )  const [inline, inherited]
 

Returns true if this ordered vector sorts lexicographically before the other one or is equivalent, false otherwise.

Definition at line 367 of file ordered_vector.I.

References ordered_vector< Key, Compare >::count(), ordered_vector< Key, Compare >::equal_range(), ordered_vector< Key, Compare >::erase(), INLINE, SIZE_TYPE, and TYPENAME.

template<class Key, class Compare>
ov_set< Key, Compare > & ov_set< Key, Compare >::operator= const ov_set< Key, Compare > &  copy  )  [inline]
 

Definition at line 940 of file ordered_vector.I.

template<class Key, class Compare>
bool ordered_vector< Key, Compare >::operator== const ordered_vector< Key, Compare > &  other  )  const [inline, inherited]
 

Returns true if the two ordered vectors are memberwise equivalent, false otherwise.

Definition at line 297 of file ordered_vector.I.

References INLINE.

template<class Key, class Compare>
bool ordered_vector< Key, Compare >::operator> const ordered_vector< Key, Compare > &  other  )  const [inline, inherited]
 

Returns true if this ordered vector sorts lexicographically after the other one, false otherwise.

Definition at line 349 of file ordered_vector.I.

References ordered_vector< Key, Compare >::_vector, and ITERATOR.

template<class Key, class Compare>
bool ordered_vector< Key, Compare >::operator>= const ordered_vector< Key, Compare > &  other  )  const [inline, inherited]
 

Returns true if this ordered vector sorts lexicographically after the other one or is equivalent, false otherwise.

Definition at line 385 of file ordered_vector.I.

References ordered_vector< Key, Compare >::_vector, and INLINE.

template<class Key, class Compare = less<Key>>
const_reference ordered_vector< Key, Compare >::operator[] size_type_0  n  )  const [inline, inherited]
 

template<class Key, class Compare = less<Key>>
reference ordered_vector< Key, Compare >::operator[] size_type_0  n  )  [inline, inherited]
 

template<class Key, class Compare = less<Key>>
void ordered_vector< Key, Compare >::push_back const value_type_0 key  )  [inline, inherited]
 

template<class Key, class Compare>
TYPENAME ordered_vector< Key, Compare >::CONST_REVERSE_ITERATOR ordered_vector< Key, Compare >::rbegin  )  const [inline, inherited]
 

Returns the iterator that marks the first element in the ordered vector, when viewed in reverse order.

Definition at line 191 of file ordered_vector.I.

References ordered_vector< Key, Compare >::_vector, INLINE, and TYPENAME.

template<class Key, class Compare>
TYPENAME ordered_vector< Key, Compare >::REVERSE_ITERATOR ordered_vector< Key, Compare >::rbegin  )  [inline, inherited]
 

Returns the iterator that marks the first element in the ordered vector, when viewed in reverse order.

Definition at line 127 of file ordered_vector.I.

References ordered_vector< Key, Compare >::_vector, INLINE, and TYPENAME.

template<class Key, class Compare>
TYPENAME ordered_vector< Key, Compare >::CONST_REVERSE_ITERATOR ordered_vector< Key, Compare >::rend  )  const [inline, inherited]
 

Returns the iterator that marks the end of the ordered vector, when viewed in reverse order.

Definition at line 207 of file ordered_vector.I.

template<class Key, class Compare>
TYPENAME ordered_vector< Key, Compare >::REVERSE_ITERATOR ordered_vector< Key, Compare >::rend  )  [inline, inherited]
 

Returns the iterator that marks the end of the ordered vector, when viewed in reverse order.

Definition at line 143 of file ordered_vector.I.

References ordered_vector< Key, Compare >::_vector, INLINE, and TYPENAME.

template<class Key, class Compare = less<Key>>
void ordered_vector< Key, Compare >::reserve size_type_0  n  )  [inline, inherited]
 

template<class Key, class Compare>
TYPENAME ordered_vector< Key, Compare >::SIZE_TYPE ordered_vector< Key, Compare >::size  )  const [inline, inherited]
 

Returns the number of elements in the ordered vector.

Definition at line 249 of file ordered_vector.I.

References ordered_vector< Key, Compare >::_vector, and INLINE.

template<class Key, class Compare>
void ov_set< Key, Compare >::sort  )  [inline]
 

Maps to sort_unique().

Definition at line 984 of file ordered_vector.I.

Referenced by VirtualFile::is_regular_file().

template<class Key, class Compare>
void ordered_vector< Key, Compare >::sort_nonunique  )  [inline, inherited]
 

Ensures that the vector is properly sorted after a potentially damaging operation.

This should not normally need to be called, unless the user has written to the vector using the non-const iterators or has called push_back().

Definition at line 835 of file ordered_vector.I.

Referenced by ordered_vector< Key, Compare >::sort_unique().

template<class Key, class Compare>
void ordered_vector< Key, Compare >::sort_unique  )  [inline, inherited]
 

Ensures that the vector is properly sorted after a potentially damaging operation.

This should not normally need to be called, unless the user has written to the vector using the non-const iterators or has called push_back().

This flavor of sort also eliminates repeated elements.

Definition at line 811 of file ordered_vector.I.

References INLINE, and ordered_vector< Key, Compare >::sort_nonunique().

template<class Key, class Compare>
void ordered_vector< Key, Compare >::swap ordered_vector< Key, Compare > &  other  )  [inline, inherited]
 

Exchanges the contents of this vector and the other vector, in constant time (e.g., with a pointer swap).

Definition at line 765 of file ordered_vector.I.

References INLINE.

template<class Key, class Compare = less<Key>>
const_iterator_0 ordered_vector< Key, Compare >::upper_bound const key_type_0 key  )  const [inline, inherited]
 

template<class Key, class Compare = less<Key>>
iterator_0 ordered_vector< Key, Compare >::upper_bound const key_type_0 key  )  [inline, inherited]
 

template<class Key, class Compare>
bool ov_set< Key, Compare >::verify_list  )  const [inline]
 

Maps to verify_list_unique().

Definition at line 998 of file ordered_vector.I.

template<class Key, class Compare = less<Key>>
bool ordered_vector< Key, Compare >::verify_list_nonunique  )  const [inherited]
 

template<class Key, class Compare = less<Key>>
bool ordered_vector< Key, Compare >::verify_list_unique  )  const [inherited]
 


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:52:59 2003 for Panda by doxygen1.3