LibreOffice Module o3tl (master)  1
Public Types | Public Member Functions | Private Types | 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 >::difference_type difference_type
 
typedef std::vector< Value >::size_type size_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 (size_t index)
 
void 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 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 DeleteAndDestroyAll ()
 
void Resort ()
 

Private Types

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

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:
Value class of item to be stored in container
Template parameter:
Compare comparison method
Template parameter:
Find look up index of a Value in the array

Definition at line 37 of file sorted_vector.hxx.

Member Typedef Documentation

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 44 of file sorted_vector.hxx.

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 45 of file sorted_vector.hxx.

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 40 of file sorted_vector.hxx.

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 42 of file sorted_vector.hxx.

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 46 of file sorted_vector.hxx.

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 41 of file sorted_vector.hxx.

Constructor & Destructor Documentation

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)
inline

Definition at line 48 of file sorted_vector.hxx.

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
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
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

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

Definition at line 167 of file sorted_vector.hxx.

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

Definition at line 151 of file sorted_vector.hxx.

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
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

Definition at line 201 of file sorted_vector.hxx.

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

Definition at line 234 of file sorted_vector.hxx.

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
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
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

Definition at line 84 of file sorted_vector.hxx.

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 ( size_t  index)
inline

Definition at line 95 of file sorted_vector.hxx.

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 &  position)
inline

Definition at line 101 of file sorted_vector.hxx.

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

Definition at line 106 of file sorted_vector.hxx.

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 116 of file sorted_vector.hxx.

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
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

Definition at line 162 of file sorted_vector.hxx.

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
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

Definition at line 73 of file sorted_vector.hxx.

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

Definition at line 216 of file sorted_vector.hxx.

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

Definition at line 179 of file sorted_vector.hxx.

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

Definition at line 211 of file sorted_vector.hxx.

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
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
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

Definition at line 206 of file sorted_vector.hxx.

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

Definition at line 172 of file sorted_vector.hxx.

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

Definition at line 133 of file sorted_vector.hxx.

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

Definition at line 249 of file sorted_vector.hxx.

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

Definition at line 140 of file sorted_vector.hxx.

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

Definition at line 128 of file sorted_vector.hxx.

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

Definition at line 184 of file sorted_vector.hxx.

Member Data Documentation

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

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