mn::container::basic_sorted_vector< TKey, TValue, TAllocator, TCompare, TStorage > Class Template Reference

#include <mn_sorted_vector.hpp>

+ Inheritance diagram for mn::container::basic_sorted_vector< TKey, TValue, TAllocator, TCompare, TStorage >:
+ Collaboration diagram for mn::container::basic_sorted_vector< TKey, TValue, TAllocator, TCompare, TStorage >:

Public Types

using key_type = TKey
 
using mapped_type = TValue
 
using size_type = typename base_type::size_type
 
using value_type = typename base_type::value_type
 
using pointer = typename base_type::pointer
 
using reference = typename base_type::reference
 
using iterator = typename base_type::iterator
 
using const_iterator = typename base_type::const_iterator
 
using allocator_type = typename base_type::allocator_type
 
using compare_type = internal::compare_func< value_type, TCompare >
 
using pair_type = basic_pair< iterator, bool >
 

Public Member Functions

 basic_sorted_vector (const allocator_type &allocator=allocator_type())
 
template<class InputIterator >
 basic_sorted_vector (InputIterator first, InputIterator last, const allocator_type &allocator=allocator_type())
 
 basic_sorted_vector (const basic_sorted_vector &)=delete
 
basic_sorted_vectoroperator= (const basic_sorted_vector &)=delete
 
pair_type insert (const value_type &val)
 
pair_type insert (const key_type &k, const mapped_type &v)
 
iterator find (const key_type &k)
 
const_iterator find (const key_type &k) const
 
iterator erase (iterator it)
 
size_type erase (const key_type &k)
 
iterator lower_bound (const key_type &k)
 
const_iterator lower_bound (const key_type &k) const
 
iterator upper_bound (const key_type &k)
 
const_iterator upper_bound (const key_type &k) const
 
iterator begin ()
 
iterator end ()
 
size_type size () const
 
bool empty () const
 
size_type capacity ()
 
void clear ()
 
const allocator_typeget_allocator () const
 
void set_allocator (const allocator_type &allocator)
 

Private Types

using base_type = basic_vector< basic_pair< TKey, TValue >, TAllocator, TStorage >
 
- Private Types inherited from mn::container::basic_vector< basic_pair< TKey, TValue >, TAllocator, basic_vector_storage< basic_pair< TKey, TValue >, TAllocator > >
using iterator_category = random_access_iterator_tag
 
using value_type = basic_pair< TKey, TValue >
 
using pointer = basic_pair< TKey, TValue > *
 
using reference = basic_pair< TKey, TValue > &
 
using lreference = basic_pair< TKey, TValue > &&
 
using const_reference = const basic_pair< TKey, TValue > &
 
using difference_type = mn::ptrdiff_t
 
using iterator = pointer
 
using const_iterator = const pointer
 
using allocator_type = TAllocator
 
using size_type = mn::size_t
 

Private Member Functions

bool invariant () const
 
- Private Member Functions inherited from mn::container::basic_vector< basic_pair< TKey, TValue >, TAllocator, basic_vector_storage< basic_pair< TKey, TValue >, TAllocator > >
 basic_vector (const allocator_type &allocator=allocator_type())
 
 basic_vector (size_type initialSize, const allocator_type &allocator=allocator_type())
 
 basic_vector (const_iterator first, const_iterator last, const allocator_type &allocator=allocator_type())
 
 basic_vector (const basic_vector &rhs, const allocator_type &allocator=allocator_type())
 
 ~basic_vector ()
 
void copy (const basic_vector &rhs)
 
iterator begin ()
 
iterator end ()
 
size_type size () const
 
bool empty () const
 
size_type capacity ()
 
pointer data ()
 
reference front ()
 
const reference cfront ()
 
reference back ()
 
const reference cback ()
 
reference at (size_type i)
 
const reference const_at (size_type i)
 
void push_back (const_reference v)
 
void push_back (lreference v)
 
void push_back ()
 
void pop_back ()
 
void assign (const pointer first, const pointer last)
 
void insert (size_type index, size_type n, const reference val)
 
void insert (iterator it, size_type n, const reference val)
 
iterator insert (iterator it, const_reference val)
 
iterator erase (iterator it)
 
iterator erase (iterator first, iterator last)
 
void resize (size_type n)
 
void reserve (size_type n)
 
void clear ()
 
void reset ()
 
void set_capacity (size_type newCapacity)
 
size_type index_of (const reference item, size_type index=0) const
 
iterator find (const reference item)
 
const allocator_typeget_allocator () const
 
void set_allocator (const allocator_type &allocator)
 
bool validate_iterator (const_iterator it) const
 
basic_vectoroperator= (const basic_vector &rhs)
 
reference operator[] (size_type i)
 
const reference operator[] (size_type i) const
 

Private Attributes

compare_type m_compare
 

Additional Inherited Members

- Static Private Attributes inherited from mn::container::basic_vector< basic_pair< TKey, TValue >, TAllocator, basic_vector_storage< basic_pair< TKey, TValue >, TAllocator > >
static const size_type npos
 
static const size_type kInitialCapacity
 

Member Typedef Documentation

◆ allocator_type

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
using mn::container::basic_sorted_vector< TKey, TValue, TAllocator, TCompare, TStorage >::allocator_type = typename base_type::allocator_type

◆ base_type

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
using mn::container::basic_sorted_vector< TKey, TValue, TAllocator, TCompare, TStorage >::base_type = basic_vector<basic_pair<TKey, TValue>, TAllocator, TStorage>
private

◆ compare_type

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
using mn::container::basic_sorted_vector< TKey, TValue, TAllocator, TCompare, TStorage >::compare_type = internal::compare_func<value_type, TCompare>

◆ const_iterator

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
using mn::container::basic_sorted_vector< TKey, TValue, TAllocator, TCompare, TStorage >::const_iterator = typename base_type::const_iterator

◆ iterator

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
using mn::container::basic_sorted_vector< TKey, TValue, TAllocator, TCompare, TStorage >::iterator = typename base_type::iterator

◆ key_type

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
using mn::container::basic_sorted_vector< TKey, TValue, TAllocator, TCompare, TStorage >::key_type = TKey

◆ mapped_type

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
using mn::container::basic_sorted_vector< TKey, TValue, TAllocator, TCompare, TStorage >::mapped_type = TValue

◆ pair_type

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
using mn::container::basic_sorted_vector< TKey, TValue, TAllocator, TCompare, TStorage >::pair_type = basic_pair<iterator, bool>

◆ pointer

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
using mn::container::basic_sorted_vector< TKey, TValue, TAllocator, TCompare, TStorage >::pointer = typename base_type::pointer

◆ reference

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
using mn::container::basic_sorted_vector< TKey, TValue, TAllocator, TCompare, TStorage >::reference = typename base_type::reference

◆ size_type

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
using mn::container::basic_sorted_vector< TKey, TValue, TAllocator, TCompare, TStorage >::size_type = typename base_type::size_type

◆ value_type

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
using mn::container::basic_sorted_vector< TKey, TValue, TAllocator, TCompare, TStorage >::value_type = typename base_type::value_type

Constructor & Destructor Documentation

◆ basic_sorted_vector() [1/3]

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
mn::container::basic_sorted_vector< TKey, TValue, TAllocator, TCompare, TStorage >::basic_sorted_vector ( const allocator_type allocator = allocator_type())
inlineexplicit

◆ basic_sorted_vector() [2/3]

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
template<class InputIterator >
mn::container::basic_sorted_vector< TKey, TValue, TAllocator, TCompare, TStorage >::basic_sorted_vector ( InputIterator  first,
InputIterator  last,
const allocator_type allocator = allocator_type() 
)
inline

◆ basic_sorted_vector() [3/3]

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
mn::container::basic_sorted_vector< TKey, TValue, TAllocator, TCompare, TStorage >::basic_sorted_vector ( const basic_sorted_vector< TKey, TValue, TAllocator, TCompare, TStorage > &  )
delete

Member Function Documentation

◆ begin()

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
iterator mn::container::basic_vector< T, TAllocator, TStorage >::begin
inline

◆ capacity()

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
size_type mn::container::basic_vector< T, TAllocator, TStorage >::capacity
inline

◆ clear()

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
void mn::container::basic_vector< T, TAllocator, TStorage >::clear
inline

◆ empty()

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
bool mn::container::basic_vector< T, TAllocator, TStorage >::empty ( void  )
inline

◆ end()

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
iterator mn::container::basic_vector< T, TAllocator, TStorage >::end
inline

◆ erase() [1/2]

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
size_type mn::container::basic_sorted_vector< TKey, TValue, TAllocator, TCompare, TStorage >::erase ( const key_type k)
inline

◆ erase() [2/2]

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
iterator mn::container::basic_sorted_vector< TKey, TValue, TAllocator, TCompare, TStorage >::erase ( iterator  it)
inline

◆ find() [1/2]

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
iterator mn::container::basic_sorted_vector< TKey, TValue, TAllocator, TCompare, TStorage >::find ( const key_type k)
inline

◆ find() [2/2]

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
const_iterator mn::container::basic_sorted_vector< TKey, TValue, TAllocator, TCompare, TStorage >::find ( const key_type k) const
inline

◆ get_allocator()

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
const allocator_type& mn::container::basic_vector< T, TAllocator, TStorage >::get_allocator
inline

◆ insert() [1/2]

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
pair_type mn::container::basic_sorted_vector< TKey, TValue, TAllocator, TCompare, TStorage >::insert ( const key_type k,
const mapped_type v 
)
inline

◆ insert() [2/2]

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
pair_type mn::container::basic_sorted_vector< TKey, TValue, TAllocator, TCompare, TStorage >::insert ( const value_type val)
inline

◆ invariant()

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
bool mn::container::basic_sorted_vector< TKey, TValue, TAllocator, TCompare, TStorage >::invariant ( ) const
inlineprivate

◆ lower_bound() [1/2]

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
iterator mn::container::basic_sorted_vector< TKey, TValue, TAllocator, TCompare, TStorage >::lower_bound ( const key_type k)
inline

◆ lower_bound() [2/2]

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
const_iterator mn::container::basic_sorted_vector< TKey, TValue, TAllocator, TCompare, TStorage >::lower_bound ( const key_type k) const
inline

◆ operator=()

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
basic_sorted_vector& mn::container::basic_sorted_vector< TKey, TValue, TAllocator, TCompare, TStorage >::operator= ( const basic_sorted_vector< TKey, TValue, TAllocator, TCompare, TStorage > &  )
delete

◆ set_allocator()

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
void mn::container::basic_vector< T, TAllocator, TStorage >::set_allocator
inline

◆ size()

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
size_type mn::container::basic_vector< T, TAllocator, TStorage >::size
inline

◆ upper_bound() [1/2]

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
iterator mn::container::basic_sorted_vector< TKey, TValue, TAllocator, TCompare, TStorage >::upper_bound ( const key_type k)
inline

◆ upper_bound() [2/2]

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
const_iterator mn::container::basic_sorted_vector< TKey, TValue, TAllocator, TCompare, TStorage >::upper_bound ( const key_type k) const
inline

Member Data Documentation

◆ m_compare

template<typename TKey , typename TValue , class TAllocator , class TCompare = mn::less<TKey>, class TStorage = basic_vector_storage< basic_pair<TKey, TValue>, TAllocator>>
compare_type mn::container::basic_sorted_vector< TKey, TValue, TAllocator, TCompare, TStorage >::m_compare
private

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