LibreOffice Module o3tl (master) 1
Public Types | Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
o3tl::sorted_vector< Value, Compare, Find, bool > Class Template Reference

Represents a sorted vector of values. More...

#include <sorted_vector.hxx>

Inheritance diagram for o3tl::sorted_vector< Value, Compare, Find, bool >:
[legend]

Public Types

typedef std::vector< Value >::const_iterator const_iterator
 
typedef std::vector< Value >::const_reverse_iterator const_reverse_iterator
 
typedef std::vector< Value >::difference_type difference_type
 
typedef std::vector< Value >::size_type size_type
 
typedef Value value_type
 

Public Member Functions

constexpr sorted_vector (std::initializer_list< Value > init)
 
 sorted_vector ()=default
 
 sorted_vector (sorted_vector const &)=default
 
 sorted_vector (sorted_vector &&)=default
 
sorted_vectoroperator= (sorted_vector const &)=default
 
sorted_vectoroperator= (sorted_vector &&)=default
 
std::pair< const_iterator, bool > insert (Value &&x)
 
std::pair< const_iterator, bool > insert (const Value &x)
 
size_type erase (const Value &x)
 
void erase_at (size_t index)
 
const_iterator erase (const_iterator const &position)
 
void erase (const_iterator const &first, const_iterator const &last)
 
Value erase_extract (size_t index)
 make erase return the removed element, otherwise there is no useful way of extracting a std::unique_ptr from this. More...
 
void clear ()
 
void swap (sorted_vector &other)
 
void reserve (size_type amount)
 
size_type size () const
 
bool empty () const
 
const_iterator begin () const
 
const_iterator end () const
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator rend () const
 
const Value & front () const
 
const Value & back () const
 
const Value & operator[] (size_t index) const
 
const_iterator lower_bound (const Value &x) const
 
const_iterator upper_bound (const Value &x) const
 
const_iterator find (const Value &x) const
 
size_type count (const Value &v) const
 
bool operator== (const sorted_vector &other) const
 
bool operator!= (const sorted_vector &other) const
 
void insert (sorted_vector< Value, Compare, Find > const &rOther)
 
void insert_sorted_unique_vector (const std::vector< Value > &rOther)
 
void insert_sorted_unique_vector (std::vector< Value > &&rOther)
 
void DeleteAndDestroyAll ()
 
void Resort ()
 

Private Types

typedef Find< Value, CompareFind_t
 
typedef std::vector< Value > vector_t
 
typedef std::vector< Value >::iterator iterator
 

Private Member Functions

void insert_internal (const std::vector< Value > &rOther)
 

Static Private Member Functions

static bool compare_equal (const Value &v1, const Value &v2)
 

Private Attributes

vector_t m_vector
 

Detailed Description

template<typename Value, typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
class o3tl::sorted_vector< Value, Compare, Find, bool >

Represents a sorted vector of values.

Template parameter: \n Value class of item to be stored in container
Template parameter: \n Compare comparison method
Template parameter: \n Find look up index of a Value in the array

Definition at line 39 of file sorted_vector.hxx.

Member Typedef Documentation

◆ const_iterator

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
typedef std::vector<Value>::const_iterator o3tl::sorted_vector< Value, Compare, Find, bool >::const_iterator

Definition at line 46 of file sorted_vector.hxx.

◆ const_reverse_iterator

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
typedef std::vector<Value>::const_reverse_iterator o3tl::sorted_vector< Value, Compare, Find, bool >::const_reverse_iterator

Definition at line 47 of file sorted_vector.hxx.

◆ difference_type

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
typedef std::vector<Value>::difference_type o3tl::sorted_vector< Value, Compare, Find, bool >::difference_type

Definition at line 48 of file sorted_vector.hxx.

◆ Find_t

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
typedef Find<Value, Compare> o3tl::sorted_vector< Value, Compare, Find, bool >::Find_t
private

Definition at line 42 of file sorted_vector.hxx.

◆ iterator

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
typedef std::vector<Value>::iterator o3tl::sorted_vector< Value, Compare, Find, bool >::iterator
private

Definition at line 44 of file sorted_vector.hxx.

◆ size_type

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
typedef std::vector<Value>::size_type o3tl::sorted_vector< Value, Compare, Find, bool >::size_type

Definition at line 49 of file sorted_vector.hxx.

◆ value_type

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
typedef Value o3tl::sorted_vector< Value, Compare, Find, bool >::value_type

Definition at line 50 of file sorted_vector.hxx.

◆ vector_t

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
typedef std::vector<Value> o3tl::sorted_vector< Value, Compare, Find, bool >::vector_t
private

Definition at line 43 of file sorted_vector.hxx.

Constructor & Destructor Documentation

◆ sorted_vector() [1/4]

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
constexpr o3tl::sorted_vector< Value, Compare, Find, bool >::sorted_vector ( std::initializer_list< Value >  init)
inlineconstexpr

◆ sorted_vector() [2/4]

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
o3tl::sorted_vector< Value, Compare, Find, bool >::sorted_vector ( )
default

◆ sorted_vector() [3/4]

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
o3tl::sorted_vector< Value, Compare, Find, bool >::sorted_vector ( sorted_vector< Value, Compare, Find, bool > const &  )
default

◆ sorted_vector() [4/4]

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
o3tl::sorted_vector< Value, Compare, Find, bool >::sorted_vector ( sorted_vector< Value, Compare, Find, bool > &&  )
default

Member Function Documentation

◆ back()

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
const Value & o3tl::sorted_vector< Value, Compare, Find, bool >::back ( ) const
inline

◆ begin()

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
const_iterator o3tl::sorted_vector< Value, Compare, Find, bool >::begin ( ) const
inline

◆ clear()

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
void o3tl::sorted_vector< Value, Compare, Find, bool >::clear ( )
inline

◆ compare_equal()

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
static bool o3tl::sorted_vector< Value, Compare, Find, bool >::compare_equal ( const Value &  v1,
const Value &  v2 
)
inlinestaticprivate

◆ count()

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
size_type o3tl::sorted_vector< Value, Compare, Find, bool >::count ( const Value &  v) const
inline

◆ DeleteAndDestroyAll()

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
void o3tl::sorted_vector< Value, Compare, Find, bool >::DeleteAndDestroyAll ( )
inline

◆ empty()

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
bool o3tl::sorted_vector< Value, Compare, Find, bool >::empty ( ) const
inline

◆ end()

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
const_iterator o3tl::sorted_vector< Value, Compare, Find, bool >::end ( ) const
inline

◆ erase() [1/3]

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
size_type o3tl::sorted_vector< Value, Compare, Find, bool >::erase ( const Value &  x)
inline

◆ erase() [2/3]

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
void o3tl::sorted_vector< Value, Compare, Find, bool >::erase ( const_iterator const &  first,
const_iterator const &  last 
)
inline

◆ erase() [3/3]

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
const_iterator o3tl::sorted_vector< Value, Compare, Find, bool >::erase ( const_iterator const &  position)
inline

◆ erase_at()

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
void o3tl::sorted_vector< Value, Compare, Find, bool >::erase_at ( size_t  index)
inline

◆ erase_extract()

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
Value o3tl::sorted_vector< Value, Compare, Find, bool >::erase_extract ( size_t  index)
inline

make erase return the removed element, otherwise there is no useful way of extracting a std::unique_ptr from this.

Definition at line 120 of file sorted_vector.hxx.

References index, o3tl::sorted_vector< Value, Compare, Find, bool >::m_vector, and Value.

◆ find()

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
const_iterator o3tl::sorted_vector< Value, Compare, Find, bool >::find ( const Value &  x) const
inline

◆ front()

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
const Value & o3tl::sorted_vector< Value, Compare, Find, bool >::front ( ) const
inline

◆ insert() [1/3]

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
std::pair< const_iterator, bool > o3tl::sorted_vector< Value, Compare, Find, bool >::insert ( const Value &  x)
inline

◆ insert() [2/3]

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
void o3tl::sorted_vector< Value, Compare, Find, bool >::insert ( sorted_vector< Value, Compare, Find > const &  rOther)
inline

◆ insert() [3/3]

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
std::pair< const_iterator, bool > o3tl::sorted_vector< Value, Compare, Find, bool >::insert ( Value &&  x)
inline

◆ insert_internal()

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
void o3tl::sorted_vector< Value, Compare, Find, bool >::insert_internal ( const std::vector< Value > &  rOther)
inlineprivate

◆ insert_sorted_unique_vector() [1/2]

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
void o3tl::sorted_vector< Value, Compare, Find, bool >::insert_sorted_unique_vector ( const std::vector< Value > &  rOther)
inline

◆ insert_sorted_unique_vector() [2/2]

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
void o3tl::sorted_vector< Value, Compare, Find, bool >::insert_sorted_unique_vector ( std::vector< Value > &&  rOther)
inline

◆ lower_bound()

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
const_iterator o3tl::sorted_vector< Value, Compare, Find, bool >::lower_bound ( const Value &  x) const
inline

◆ operator!=()

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
bool o3tl::sorted_vector< Value, Compare, Find, bool >::operator!= ( const sorted_vector< Value, Compare, Find, bool > &  other) const
inline

◆ operator=() [1/2]

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
sorted_vector & o3tl::sorted_vector< Value, Compare, Find, bool >::operator= ( sorted_vector< Value, Compare, Find, bool > &&  )
default

◆ operator=() [2/2]

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
sorted_vector & o3tl::sorted_vector< Value, Compare, Find, bool >::operator= ( sorted_vector< Value, Compare, Find, bool > const &  )
default

◆ operator==()

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
bool o3tl::sorted_vector< Value, Compare, Find, bool >::operator== ( const sorted_vector< Value, Compare, Find, bool > &  other) const
inline

◆ operator[]()

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
const Value & o3tl::sorted_vector< Value, Compare, Find, bool >::operator[] ( size_t  index) const
inline

◆ rbegin()

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
const_reverse_iterator o3tl::sorted_vector< Value, Compare, Find, bool >::rbegin ( ) const
inline

◆ rend()

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
const_reverse_iterator o3tl::sorted_vector< Value, Compare, Find, bool >::rend ( ) const
inline

◆ reserve()

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
void o3tl::sorted_vector< Value, Compare, Find, bool >::reserve ( size_type  amount)
inline

◆ Resort()

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
void o3tl::sorted_vector< Value, Compare, Find, bool >::Resort ( )
inline

◆ size()

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
size_type o3tl::sorted_vector< Value, Compare, Find, bool >::size ( ) const
inline

◆ swap()

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
void o3tl::sorted_vector< Value, Compare, Find, bool >::swap ( sorted_vector< Value, Compare, Find, bool > &  other)
inline

◆ upper_bound()

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
const_iterator o3tl::sorted_vector< Value, Compare, Find, bool >::upper_bound ( const Value &  x) const
inline

Member Data Documentation

◆ m_vector

template<typename Value , typename Compare = std::less<Value>, template< typename, typename > class Find = find_unique, bool = std::is_copy_constructible<Value>::value>
vector_t o3tl::sorted_vector< Value, Compare, Find, bool >::m_vector
private

Definition at line 301 of file sorted_vector.hxx.

Referenced by o3tl::sorted_vector< Value, Compare, Find, bool >::back(), o3tl::sorted_vector< Value, Compare, Find, bool >::begin(), o3tl::sorted_vector< Value, Compare, Find, bool >::clear(), o3tl::sorted_vector< Value, Compare, Find, bool >::DeleteAndDestroyAll(), o3tl::sorted_vector< Value, Compare, Find, bool >::empty(), o3tl::sorted_vector< Value, Compare, Find, bool >::end(), o3tl::sorted_vector< Value, Compare, Find, bool >::erase(), o3tl::sorted_vector< Value, Compare, Find, bool >::erase_at(), o3tl::sorted_vector< Value, Compare, Find, bool >::erase_extract(), o3tl::sorted_vector< Value, Compare, Find, bool >::find(), o3tl::sorted_vector< Value, Compare, Find, bool >::front(), o3tl::sorted_vector< Value, Compare, Find, bool >::insert(), o3tl::sorted_vector< Value, Compare, Find, bool >::insert_internal(), o3tl::sorted_vector< Value, Compare, Find, bool >::insert_sorted_unique_vector(), o3tl::sorted_vector< Value, Compare, Find, bool >::lower_bound(), o3tl::sorted_vector< Value, Compare, Find, bool >::operator!=(), o3tl::sorted_vector< Value, Compare, Find, bool >::operator==(), o3tl::sorted_vector< Value, Compare, Find, bool >::operator[](), o3tl::sorted_vector< Value, Compare, Find, bool >::rbegin(), o3tl::sorted_vector< Value, Compare, Find, bool >::rend(), o3tl::sorted_vector< Value, Compare, Find, bool >::reserve(), o3tl::sorted_vector< Value, Compare, Find, bool >::Resort(), o3tl::sorted_vector< Value, Compare, Find, bool >::size(), o3tl::sorted_vector< Value, Compare, Find, bool >::sorted_vector(), o3tl::sorted_vector< Value, Compare, Find, bool >::swap(), and o3tl::sorted_vector< Value, Compare, Find, bool >::upper_bound().


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