#include <ordered_vector.h>
Inheritance diagram for ordered_vector< Key, Compare >:
Public Types | |
typedef Key | key_type_0 |
typedef Key | value_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::iterator | iterator_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 | |
ordered_vector (const Compare &compare=Compare()) | |
ordered_vector (const ordered_vector< Key, Compare > ©) | |
ordered_vector< Key, Compare > & | operator= (const ordered_vector< Key, Compare > ©) |
~ordered_vector () | |
iterator_0 | begin () |
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. | |
reverse_iterator_0 | rbegin () |
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_iterator_0 | begin () const |
Returns the iterator that marks the first element in the ordered vector. | |
const_iterator_0 | end () const |
Returns the iterator that marks the end of the ordered vector. | |
const_reverse_iterator_0 | rbegin () const |
Returns the iterator that marks the first element in 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) |
iterator_0 | insert_nonunique (iterator_0 position, const value_type_0 &key) |
pair< iterator_0, bool > | insert_unique (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_0 > | equal_range (const key_type_0 &key) |
pair< const_iterator_0, const_iterator_0 > | equal_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) |
Private Types | |
typedef pvector< Key > | Vector |
Private Member Functions | |
iterator_0 | nci (const_iterator_0 i) |
iterator_0 | find_insert_position (iterator_0 first, iterator_0 last, const key_type_0 &key) |
iterator_0 | r_find_insert_position (iterator_0 first, iterator_0 last, const key_type_0 &key) |
const_iterator_0 | r_find (const_iterator_0 first, const_iterator_0 last, const_iterator_0 not_found, const key_type_0 &key) const |
const_iterator_0 | r_find_particular (const_iterator_0 first, const_iterator_0 last, const_iterator_0 not_found, const key_type_0 &key) const |
size_type_0 | r_count (const_iterator_0 first, const_iterator_0 last, const key_type_0 &key) const |
const_iterator_0 | r_lower_bound (const_iterator_0 first, const_iterator_0 last, const key_type_0 &key) const |
const_iterator_0 | r_upper_bound (const_iterator_0 first, const_iterator_0 last, const key_type_0 &key) const |
pair< const_iterator_0, const_iterator_0 > | r_equal_range (const_iterator_0 first, const_iterator_0 last, const key_type_0 &key) const |
Private Attributes | |
Compare | _compare |
Vector | _vector |
In most cases, an ov_set or ov_multiset may be dropped in transparently in place of a set or multiset, but the implementation difference has a few implications:
(1) The ov_multiset will maintain stability of order between elements that sort equally: they are stored in the order in which they were added, from back to front.
(2) Insert and erase operations into the middle of the set can be slow, just as inserting into the middle of a vector can be slow. In fact, building up an ov_set by inserting elements one at a time is an n^2 operation. On the other hand, building up an ov_set by adding elements to the end, one at time, is somewhat faster than building up a traditional set; and you can even add unsorted elements with push_back() and then call sort() when you're done, for a log(n) operation.
(3) Iterators may not be valid for the life of the ordered_vector. If the vector reallocates itself, all iterators are invalidated.
(4) Random access into the set is easy with the [] operator.
Definition at line 130 of file ordered_vector.h.
|
Definition at line 164 of file ordered_vector.h. |
|
Definition at line 147 of file ordered_vector.h. |
|
Definition at line 160 of file ordered_vector.h. |
|
Definition at line 139 of file ordered_vector.h. |
|
Definition at line 166 of file ordered_vector.h. |
|
Definition at line 149 of file ordered_vector.h. |
|
Definition at line 167 of file ordered_vector.h. |
|
Definition at line 151 of file ordered_vector.h. |
|
Definition at line 163 of file ordered_vector.h. |
|
Reimplemented in ov_set< Key, Compare >, and ov_multiset< Key, Compare >. Definition at line 146 of file ordered_vector.h. |
|
Definition at line 161 of file ordered_vector.h. |
|
Definition at line 140 of file ordered_vector.h. |
|
Definition at line 157 of file ordered_vector.h. |
|
Definition at line 136 of file ordered_vector.h. |
|
Definition at line 159 of file ordered_vector.h. |
|
Definition at line 138 of file ordered_vector.h. |
|
Definition at line 165 of file ordered_vector.h. |
|
Definition at line 148 of file ordered_vector.h. |
|
Definition at line 168 of file ordered_vector.h. |
|
Definition at line 152 of file ordered_vector.h. |
|
Definition at line 162 of file ordered_vector.h. |
|
Definition at line 141 of file ordered_vector.h. |
|
Definition at line 158 of file ordered_vector.h. |
|
Reimplemented in ov_set< Key, Compare >, and ov_multiset< Key, Compare >. Definition at line 137 of file ordered_vector.h. |
|
Definition at line 132 of file ordered_vector.h. |
|
Definition at line 33 of file ordered_vector.I. References INLINE. |
|
Definition at line 48 of file ordered_vector.I. References ordered_vector< Key, Compare >::_compare, ordered_vector< Key, Compare >::_vector, and INLINE. |
|
Definition at line 80 of file ordered_vector.I. References ordered_vector< Key, Compare >::_vector, INLINE, and TYPENAME. |
|
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. |
|
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<(). |
|
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. |
|
Referenced by ordered_vector< Key, Compare >::operator<=(). |
|
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. |
|
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. |
|
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<(). |
|
|
|
Referenced by ordered_vector< Key, Compare >::operator<=(). |
|
|
|
|
|
Referenced by ordered_vector< Key, Compare >::operator<=(). |
|
|
|
|
|
Referenced by ordered_vector< Key, Compare >::operator!=(), and ordered_vector< Key, Compare >::operator<(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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. |
|
|
|
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. |
|
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. |
|
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. |
|
Definition at line 64 of file ordered_vector.I. References INLINE. |
|
Returns true if the two ordered vectors are memberwise equivalent, false otherwise.
Definition at line 297 of file ordered_vector.I. References INLINE. |
|
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. |
|
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. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Referenced by ordered_vector< Key, Compare >::clear(). |
|
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. |
|
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. |
|
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. |
|
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. |
|
|
|
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. |
|
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(). |
|
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(). |
|
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. |
|
|
|
|
|
|
|
|
|
Definition at line 283 of file ordered_vector.h. Referenced by ordered_vector< Key, Compare >::operator!=(), and ordered_vector< Key, Compare >::ordered_vector(). |
|