![]() |
mutable
A Database System for Research and Fast Prototyping
|
A sorted list of elements. More...
#include <ADT.hpp>
Public Types | |
using | vector_type = std::vector< T > |
the type of the internal container of elements | |
using | value_type = T |
using | size_type = typename vector_type::size_type |
Public Member Functions | |
sorted_vector (Compare comp=Compare()) | |
auto | begin () |
auto | end () |
auto | begin () const |
auto | end () const |
auto | cbegin () const |
auto | cend () const |
auto | empty () const |
Returns true iff the sorted_vector has no elements. | |
auto | size () const |
Returns the number of elements in this sorted_vector . | |
auto | reserve (size_type new_cap) |
Reserves space for new_cap elements in this sorted_vector . | |
bool | contains (const T &value) const |
Returns true iff this sorted_vector contains an element that is equal to value . | |
auto | insert (T value) |
Inserts value into this sorted_vector . | |
template<typename InsertIt > | |
void | insert (InsertIt first, InsertIt last) |
Inserts elements in the range from first (including) to last (excluding) into this `sorted_vector. | |
Private Attributes | |
Compare | comp_ |
vector_type | v_ |
the internal container of elements | |
A sorted list of elements.
Allows duplicates.
using m::sorted_vector< T, Compare >::size_type = typename vector_type::size_type |
using m::sorted_vector< T, Compare >::value_type = T |
using m::sorted_vector< T, Compare >::vector_type = std::vector<T> |
|
inline |
|
inline |
Definition at line 796 of file ADT.hpp.
References m::sorted_vector< T, Compare >::v_.
Referenced by m::sorted_vector< T, Compare >::contains(), and m::sorted_vector< T, Compare >::insert().
|
inline |
Definition at line 798 of file ADT.hpp.
References m::sorted_vector< T, Compare >::v_.
|
inline |
Definition at line 800 of file ADT.hpp.
References m::sorted_vector< T, Compare >::v_.
|
inline |
Definition at line 801 of file ADT.hpp.
References m::sorted_vector< T, Compare >::v_.
|
inline |
Returns true
iff this sorted_vector
contains an element that is equal to value
.
Definition at line 811 of file ADT.hpp.
References m::and, m::sorted_vector< T, Compare >::begin(), m::sorted_vector< T, Compare >::comp_, and m::sorted_vector< T, Compare >::end().
|
inline |
Returns true
iff the sorted_vector
has no elements.
Definition at line 804 of file ADT.hpp.
References m::sorted_vector< T, Compare >::v_.
|
inline |
Definition at line 797 of file ADT.hpp.
References m::sorted_vector< T, Compare >::v_.
Referenced by m::sorted_vector< T, Compare >::contains(), and m::sorted_vector< T, Compare >::insert().
|
inline |
Definition at line 799 of file ADT.hpp.
References m::sorted_vector< T, Compare >::v_.
|
inline |
Inserts elements in the range from first
(including) to last
(excluding) into this `sorted_vector.
Definition at line 821 of file ADT.hpp.
References m::sorted_vector< T, Compare >::insert().
|
inline |
Inserts value
into this sorted_vector
.
Returns an iterator
pointing to the inserted element.
Definition at line 817 of file ADT.hpp.
References m::sorted_vector< T, Compare >::begin(), m::sorted_vector< T, Compare >::comp_, m::sorted_vector< T, Compare >::end(), and m::sorted_vector< T, Compare >::v_.
Referenced by m::sorted_vector< T, Compare >::insert().
|
inline |
Reserves space for new_cap
elements in this sorted_vector
.
Definition at line 808 of file ADT.hpp.
References m::sorted_vector< T, Compare >::v_.
|
inline |
Returns the number of elements in this sorted_vector
.
Definition at line 806 of file ADT.hpp.
References m::sorted_vector< T, Compare >::v_.
|
private |
Definition at line 790 of file ADT.hpp.
Referenced by m::sorted_vector< T, Compare >::contains(), and m::sorted_vector< T, Compare >::insert().
|
private |
the internal container of elements
Definition at line 791 of file ADT.hpp.
Referenced by m::sorted_vector< T, Compare >::begin(), m::sorted_vector< T, Compare >::cbegin(), m::sorted_vector< T, Compare >::cend(), m::sorted_vector< T, Compare >::empty(), m::sorted_vector< T, Compare >::end(), m::sorted_vector< T, Compare >::insert(), m::sorted_vector< T, Compare >::reserve(), and m::sorted_vector< T, Compare >::size().