17 template<
class Key,
class Compare,
class Vector>
28 template<
class Key,
class Compare,
class Vector>
39 template<
class Key,
class Compare,
class Vector>
42 return _vector.begin();
48 template<
class Key,
class Compare,
class Vector>
58 template<
class Key,
class Compare,
class Vector>
61 return _vector.rbegin();
68 template<
class Key,
class Compare,
class Vector>
71 return _vector.rend();
77 template<
class Key,
class Compare,
class Vector>
80 return _vector.begin();
86 template<
class Key,
class Compare,
class Vector>
96 template<
class Key,
class Compare,
class Vector>
99 return _vector.rbegin();
106 template<
class Key,
class Compare,
class Vector>
109 return _vector.rend();
115 template<
class Key,
class Compare,
class Vector>
118 return _vector.begin();
124 template<
class Key,
class Compare,
class Vector>
127 return _vector.end();
134 template<
class Key,
class Compare,
class Vector>
137 return _vector.rbegin();
144 template<
class Key,
class Compare,
class Vector>
147 return _vector.rend();
153 template<
class Key,
class Compare,
class Vector>
162 template<
class Key,
class Compare,
class Vector>
171 template<
class Key,
class Compare,
class Vector>
175 assert(!_vector.empty());
183 template<
class Key,
class Compare,
class Vector>
187 assert(!_vector.empty());
195 template<
class Key,
class Compare,
class Vector>
199 assert(!_vector.empty());
201 return _vector[_vector.size() - 1];
207 template<
class Key,
class Compare,
class Vector>
211 assert(!_vector.empty());
213 return _vector[_vector.size() - 1];
219 template<
class Key,
class Compare,
class Vector>
222 return _vector.size();
229 template<
class Key,
class Compare,
class Vector>
232 return _vector.max_size();
238 template<
class Key,
class Compare,
class Vector>
241 return _vector.empty();
248 template<
class Key,
class Compare,
class Vector>
251 return _vector == other._vector;
258 template<
class Key,
class Compare,
class Vector>
261 return _vector != other._vector;
268 template<
class Key,
class Compare,
class Vector>
271 return _vector < other._vector;
278 template<
class Key,
class Compare,
class Vector>
281 return _vector > other._vector;
288 template<
class Key,
class Compare,
class Vector>
291 return _vector <= other._vector;
298 template<
class Key,
class Compare,
class Vector>
301 return _vector >= other._vector;
314 template<
class Key,
class Compare,
class Vector>
317 TAU_PROFILE(
"ordered_vector::insert_unique(const value_type &)",
" ", TAU_USER);
318 ITERATOR position = find_insert_position(begin(), end(), key);
320 std::pair<ITERATOR, bool> bogus_result(end(),
false);
321 nassertr(position >= begin() && position <= end(), bogus_result);
326 if (position != begin() && !_compare(*(position - 1), key)) {
327 std::pair<ITERATOR, bool> result(position - 1,
false);
328 nassertr(!_compare(key, *(position - 1)), result);
332 ITERATOR result = _vector.insert(position, key);
333 return std::pair<ITERATOR, bool>(result,
true);
343 template<
class Key,
class Compare,
class Vector>
346 TAU_PROFILE(
"ordered_vector::insert_nonunique(const value_type &)",
" ", TAU_USER);
347 ITERATOR position = find_insert_position(begin(), end(), key);
348 nassertr(position >= begin() && position <= end(), end());
350 ITERATOR result = _vector.insert(position, key);
360 template<
class Key,
class Compare,
class Vector>
364 TAU_PROFILE(
"ordered_vector::insert_unverified(iterator, const value_type &)",
" ", TAU_USER);
365 ITERATOR result = _vector.insert(position, key);
373 template<
class Key,
class Compare,
class Vector>
376 TAU_PROFILE(
"ordered_vector::erase(iterator)",
" ", TAU_USER);
377 SIZE_TYPE count = position - begin();
378 _vector.erase(position);
379 return begin() + count;
386 template<
class Key,
class Compare,
class Vector>
389 TAU_PROFILE(
"ordered_vector::erase(const key_type &)",
" ", TAU_USER);
390 std::pair<ITERATOR, ITERATOR> result = equal_range(key);
391 SIZE_TYPE count = result.second - result.first;
392 erase(result.first, result.second);
399 template<
class Key,
class Compare,
class Vector>
403 TAU_PROFILE(
"ordered_vector::erase(iterator, iterator)",
" ", TAU_USER);
404 _vector.erase(first, last);
410 template<
class Key,
class Compare,
class Vector>
413 TAU_PROFILE(
"ordered_vector::clear()",
" ", TAU_USER);
414 _vector.erase(_vector.begin(), _vector.end());
422 template<
class Key,
class Compare,
class Vector>
425 TAU_PROFILE(
"ordered_vector::find(const key_type &)",
" ", TAU_USER);
426 return nci(r_find(begin(), end(), end(), key));
434 template<
class Key,
class Compare,
class Vector>
437 TAU_PROFILE(
"ordered_vector::find(const key_type &)",
" ", TAU_USER);
438 return r_find(begin(), end(), end(), key);
454 template<
class Key,
class Compare,
class Vector>
457 TAU_PROFILE(
"ordered_vector::find_particular(const key_type &)",
" ", TAU_USER);
458 return nci(r_find_particular(begin(), end(), end(), key));
471 template<
class Key,
class Compare,
class Vector>
474 TAU_PROFILE(
"ordered_vector::find_particular(const key_type &)",
" ", TAU_USER);
475 return r_find_particular(begin(), end(), end(), key);
482 template<
class Key,
class Compare,
class Vector>
485 TAU_PROFILE(
"ordered_vector::count(const key_type &)",
" ", TAU_USER);
486 return r_count(begin(), end(), key);
493 template<
class Key,
class Compare,
class Vector>
496 TAU_PROFILE(
"ordered_vector::lower_bound(const key_type &)",
" ", TAU_USER);
497 return nci(r_lower_bound(begin(), end(), key));
504 template<
class Key,
class Compare,
class Vector>
507 TAU_PROFILE(
"ordered_vector::lower_bound(const key_type &)",
" ", TAU_USER);
508 return r_lower_bound(begin(), end(), key);
515 template<
class Key,
class Compare,
class Vector>
518 TAU_PROFILE(
"ordered_vector::upper_bound(const key_type &)",
" ", TAU_USER);
519 return nci(r_upper_bound(begin(), end(), key));
526 template<
class Key,
class Compare,
class Vector>
529 TAU_PROFILE(
"ordered_vector::upper_bound(const key_type &)",
" ", TAU_USER);
530 return r_upper_bound(begin(), end(), key);
536 template<
class Key,
class Compare,
class Vector>
539 TAU_PROFILE(
"ordered_vector::equal_range(const key_type &)",
" ", TAU_USER);
541 result = r_equal_range(begin(), end(), key);
548 template<
class Key,
class Compare,
class Vector>
551 TAU_PROFILE(
"ordered_vector::equal_range(const key_type &)",
" ", TAU_USER);
552 return r_equal_range(begin(), end(), key);
559 template<
class Key,
class Compare,
class Vector>
562 TAU_PROFILE(
"ordered_vector::swap(ordered_vector &)",
" ", TAU_USER);
563 _vector.swap(copy._vector);
570 template<
class Key,
class Compare,
class Vector>
573 TAU_PROFILE(
"ordered_vector::reserve(size_type)",
" ", TAU_USER);
585 template<
class Key,
class Compare,
class Vector>
588 TAU_PROFILE(
"ordered_vector::sort_unique()",
" ", TAU_USER);
589 sort(begin(), end(), _compare);
590 iterator new_end = unique(begin(), end(), EquivalentTest(_compare));
591 erase(new_end, end());
600 template<
class Key,
class Compare,
class Vector>
603 TAU_PROFILE(
"ordered_vector::sort_nonunique()",
" ", TAU_USER);
604 std::stable_sort(begin(), end(), _compare);
612 template<
class Key,
class Compare,
class Vector>
615 TAU_PROFILE(
"ordered_vector::push_back()",
" ", TAU_USER);
616 _vector.push_back(key);
624 template<
class Key,
class Compare,
class Vector>
627 TAU_PROFILE(
"ordered_vector::push_back()",
" ", TAU_USER);
628 _vector.push_back(std::move(key));
634 template<
class Key,
class Compare,
class Vector>
637 TAU_PROFILE(
"ordered_vector::pop_back()",
" ", TAU_USER);
645 template<
class Key,
class Compare,
class Vector>
648 TAU_PROFILE(
"ordered_vector::resize()",
" ", TAU_USER);
656 template<
class Key,
class Compare,
class Vector>
658 resize(SIZE_TYPE n,
const VALUE_TYPE &value) {
659 TAU_PROFILE(
"ordered_vector::resize()",
" ", TAU_USER);
660 _vector.resize(n, value);
668 template<
class Key,
class Compare,
class Vector>
671 return begin() + (i - begin());
678 template<
class Key,
class Compare,
class Vector>
683 ITERATOR result = r_find_insert_position(first, last, key);
690 template<
class Key,
class Compare,
class Vector>
700 template<
class Key,
class Compare,
class Vector>
710 template<
class Key,
class Compare,
class Vector>
720 template<
class Key,
class Compare,
class Vector>
729 template<
class Key,
class Compare,
class Vector>
738 template<
class Key,
class Compare,
class Vector>
747 template<
class Key,
class Compare,
class Vector>
757 template<
class Key,
class Compare,
class Vector>
767 template<
class Key,
class Compare,
class Vector>
777 template<
class Key,
class Compare,
class Vector>
786 template<
class Key,
class Compare,
class Vector>
795 template<
class Key,
class Compare,
class Vector>
This template class presents an interface similar to the STL set or multiset (and ov_set and ov_multi...
bool operator >(const ordered_vector< Key, Compare, Vector > &other) const
Returns true if this ordered vector sorts lexicographically after the other one, false otherwise.
void pop_back()
Removes the last element at the end of the vector.
bool operator !=(const ordered_vector< Key, Compare, Vector > &other) const
Returns true if the two ordered vectors are not memberwise equivalent, false if they are.
void sort_unique()
Ensures that the vector is properly sorted after a potentially damaging operation.
size_type_0 size() const
Returns the number of elements in the ordered vector.
void clear()
Removes all elements from the ordered vector.
void sort_nonunique()
Ensures that the vector is properly sorted after a potentially damaging operation.
bool verify_list() const
Maps to verify_list_unique().
bool verify_list() const
Maps to verify_list_nonunique().
iterator_0 begin()
Returns the iterator that marks the first element in the ordered vector.
reference back()
Returns a reference to the first element.
iterator_0 end()
Returns the iterator that marks the end of the ordered vector.
void reserve(size_type_0 n)
Informs the vector of a planned change in size; ensures that the capacity of the vector is greater th...
bool operator==(const ordered_vector< Key, Compare, Vector > &other) const
Returns true if the two ordered vectors are memberwise equivalent, false otherwise.
bool empty() const
Returns true if the ordered vector is empty, false otherwise.
A specialization of ordered_vector that emulates a standard STL set: one copy of each element is allo...
const_iterator_0 cbegin() const
Returns the iterator that marks the first element in the ordered vector.
void swap(ordered_vector< Key, Compare, Vector > &other)
Exchanges the contents of this vector and the other vector, in constant time (e.g....
bool operator<(const ordered_vector< Key, Compare, Vector > &other) const
Returns true if this ordered vector sorts lexicographically before the other one, false otherwise.
reference front()
Returns a reference to the first element.
iterator_0 insert_unverified(iterator_0 position, const value_type_0 &key)
Inserts the indicated key into the ordered vector at the indicated place.
const_reverse_iterator_0 crend() const
Returns the iterator that marks the end of the ordered vector, when viewed in reverse order.
size_type_0 max_size() const
Returns the maximum number of elements that can possibly be stored in an ordered vector.
void sort()
Maps to sort_nonunique().
const_iterator_0 cend() const
Returns the iterator that marks the end of the ordered vector.
void sort()
Maps to sort_unique().
reverse_iterator_0 rbegin()
Returns the iterator that marks the first element in the ordered vector, when viewed in reverse order...
A specialization of ordered_vector that emulates a standard STL set: many copies of each element are ...
bool operator >=(const ordered_vector< Key, Compare, Vector > &other) const
Returns true if this ordered vector sorts lexicographically after the other one or is equivalent,...
void push_back(const value_type_0 &key)
Adds the new element to the end of the vector without regard for proper sorting.
reverse_iterator_0 rend()
Returns the iterator that marks the end of the ordered vector, when viewed in reverse order.
size_type_0 count(const key_type_0 &key) const
Returns the number of elements that sort equivalent to the key that are in the vector.
const_reverse_iterator_0 crbegin() const
Returns the iterator that marks the first element in the ordered vector, when viewed in reverse order...
TypeHandle is the identifier used to differentiate C++ class types.
bool operator<=(const ordered_vector< Key, Compare, Vector > &other) const
Returns true if this ordered vector sorts lexicographically before the other one or is equivalent,...