momo  3.9
momo::stdish::multiset< TKey, TLessFunc, TAllocator, TTreeSet > Class Template Reference

momo::stdish::multiset is similar to std::multiset, but much more efficient in memory usage. The implementation is based on a B-tree. More...

#include <set.h>

Inheritance diagram for momo::stdish::multiset< TKey, TLessFunc, TAllocator, TTreeSet >:

Public Types

typedef iterator insert_return_type
 
typedef size_t size_type
 
typedef key_type value_type
 
typedef TreeSet::Iterator iterator
 
typedef internal::set_node_handle< typename TreeSet::ExtractedItemnode_type
 

Public Member Functions

multisetoperator= (std::initializer_list< value_type > values)
 
iterator insert (value_type &&value)
 
iterator insert (const value_type &value)
 
iterator insert (node_type &&node)
 
template<typename... ValueArgs>
iterator emplace (ValueArgs &&... valueArgs)
 
std::pair< iterator, bool > insert (value_type &&value)
 
iterator insert (const_iterator hint, value_type &&value)
 
std::pair< iterator, bool > insert (const value_type &value)
 
iterator insert (const_iterator hint, const value_type &value)
 
insert_return_type insert (node_type &&node)
 
iterator insert (const_iterator hint, node_type &&node)
 
template<typename Iterator >
void insert (Iterator first, Iterator last)
 
void insert (std::initializer_list< value_type > values)
 

Friends

void swap (multiset &left, multiset &right) noexcept
 
template<typename ValueFilter >
size_type erase_if (multiset &cont, const ValueFilter &valueFilter)
 

Detailed Description

template<typename TKey, typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<TKey>, typename TTreeSet = TreeSet<TKey, TreeTraitsStd<TKey, TLessFunc, true>, MemManagerStd<TAllocator>>>
class momo::stdish::multiset< TKey, TLessFunc, TAllocator, TTreeSet >

momo::stdish::multiset is similar to std::multiset, but much more efficient in memory usage. The implementation is based on a B-tree.

Deviations from standard class:

  1. Container items must be movable (preferably without exceptions) or copyable, similar to items of std::vector.
  2. After each addition or removal of the item all iterators and references to items become invalid and should not be used.
  3. Functions begin, cbegin, rend and crend have logarithmic complexity.
  4. If ObjectManager<key_type>::isNothrowAnywayAssignable is false, functions erase can throw exceptions.
  5. Functions merge, extract and insert(node_type&&) move items.

It is allowed to pass to functions insert and emplace references to items within the container.

Function merge can work fast, if container types are same and each key from one container is less than each key from other container.

Member Typedef Documentation

◆ insert_return_type

template<typename TKey , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<TKey>, typename TTreeSet = TreeSet<TKey, TreeTraitsStd<TKey, TLessFunc, true>, MemManagerStd<TAllocator>>>
typedef iterator momo::stdish::multiset< TKey, TLessFunc, TAllocator, TTreeSet >::insert_return_type

◆ iterator

template<typename TKey , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<TKey>, typename TTreeSet = TreeSet<TKey, TreeTraitsStd<TKey, TLessFunc, true>, MemManagerStd<TAllocator>>>
typedef TreeSet::Iterator momo::stdish::set< TKey, TLessFunc, TAllocator, TTreeSet >::iterator

◆ node_type

template<typename TKey , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<TKey>, typename TTreeSet = TreeSet<TKey, TreeTraitsStd<TKey, TLessFunc, true>, MemManagerStd<TAllocator>>>
typedef internal::set_node_handle<typename TreeSet::ExtractedItem> momo::stdish::set< TKey, TLessFunc, TAllocator, TTreeSet >::node_type

◆ size_type

template<typename TKey , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<TKey>, typename TTreeSet = TreeSet<TKey, TreeTraitsStd<TKey, TLessFunc, true>, MemManagerStd<TAllocator>>>
typedef size_t momo::stdish::set< TKey, TLessFunc, TAllocator, TTreeSet >::size_type

◆ value_type

template<typename TKey , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<TKey>, typename TTreeSet = TreeSet<TKey, TreeTraitsStd<TKey, TLessFunc, true>, MemManagerStd<TAllocator>>>
typedef key_type momo::stdish::set< TKey, TLessFunc, TAllocator, TTreeSet >::value_type

Member Function Documentation

◆ emplace()

template<typename TKey , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<TKey>, typename TTreeSet = TreeSet<TKey, TreeTraitsStd<TKey, TLessFunc, true>, MemManagerStd<TAllocator>>>
template<typename... ValueArgs>
iterator momo::stdish::multiset< TKey, TLessFunc, TAllocator, TTreeSet >::emplace ( ValueArgs &&...  valueArgs)
inline

◆ insert() [1/11]

template<typename TKey , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<TKey>, typename TTreeSet = TreeSet<TKey, TreeTraitsStd<TKey, TLessFunc, true>, MemManagerStd<TAllocator>>>
std::pair<iterator, bool> momo::stdish::set< TKey, TLessFunc, TAllocator, TTreeSet >::insert
inline

◆ insert() [2/11]

template<typename TKey , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<TKey>, typename TTreeSet = TreeSet<TKey, TreeTraitsStd<TKey, TLessFunc, true>, MemManagerStd<TAllocator>>>
iterator momo::stdish::multiset< TKey, TLessFunc, TAllocator, TTreeSet >::insert ( const value_type value)
inline

◆ insert() [3/11]

template<typename TKey , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<TKey>, typename TTreeSet = TreeSet<TKey, TreeTraitsStd<TKey, TLessFunc, true>, MemManagerStd<TAllocator>>>
iterator momo::stdish::set< TKey, TLessFunc, TAllocator, TTreeSet >::insert
inline

◆ insert() [4/11]

template<typename TKey , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<TKey>, typename TTreeSet = TreeSet<TKey, TreeTraitsStd<TKey, TLessFunc, true>, MemManagerStd<TAllocator>>>
iterator momo::stdish::set< TKey, TLessFunc, TAllocator, TTreeSet >::insert
inline

◆ insert() [5/11]

template<typename TKey , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<TKey>, typename TTreeSet = TreeSet<TKey, TreeTraitsStd<TKey, TLessFunc, true>, MemManagerStd<TAllocator>>>
iterator momo::stdish::set< TKey, TLessFunc, TAllocator, TTreeSet >::insert
inline

◆ insert() [6/11]

template<typename TKey , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<TKey>, typename TTreeSet = TreeSet<TKey, TreeTraitsStd<TKey, TLessFunc, true>, MemManagerStd<TAllocator>>>
template<typename Iterator >
void momo::stdish::set< TKey, TLessFunc, TAllocator, TTreeSet >::insert ( typename Iterator  )
inline

◆ insert() [7/11]

template<typename TKey , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<TKey>, typename TTreeSet = TreeSet<TKey, TreeTraitsStd<TKey, TLessFunc, true>, MemManagerStd<TAllocator>>>
insert_return_type momo::stdish::set< TKey, TLessFunc, TAllocator, TTreeSet >::insert
inline

◆ insert() [8/11]

template<typename TKey , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<TKey>, typename TTreeSet = TreeSet<TKey, TreeTraitsStd<TKey, TLessFunc, true>, MemManagerStd<TAllocator>>>
iterator momo::stdish::multiset< TKey, TLessFunc, TAllocator, TTreeSet >::insert ( node_type &&  node)
inline

◆ insert() [9/11]

template<typename TKey , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<TKey>, typename TTreeSet = TreeSet<TKey, TreeTraitsStd<TKey, TLessFunc, true>, MemManagerStd<TAllocator>>>
void momo::stdish::set< TKey, TLessFunc, TAllocator, TTreeSet >::insert
inline

◆ insert() [10/11]

template<typename TKey , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<TKey>, typename TTreeSet = TreeSet<TKey, TreeTraitsStd<TKey, TLessFunc, true>, MemManagerStd<TAllocator>>>
std::pair<iterator, bool> momo::stdish::set< TKey, TLessFunc, TAllocator, TTreeSet >::insert
inline

◆ insert() [11/11]

template<typename TKey , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<TKey>, typename TTreeSet = TreeSet<TKey, TreeTraitsStd<TKey, TLessFunc, true>, MemManagerStd<TAllocator>>>
iterator momo::stdish::multiset< TKey, TLessFunc, TAllocator, TTreeSet >::insert ( value_type &&  value)
inline

◆ operator=()

template<typename TKey , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<TKey>, typename TTreeSet = TreeSet<TKey, TreeTraitsStd<TKey, TLessFunc, true>, MemManagerStd<TAllocator>>>
multiset& momo::stdish::multiset< TKey, TLessFunc, TAllocator, TTreeSet >::operator= ( std::initializer_list< value_type values)
inline

Friends And Related Function Documentation

◆ erase_if

template<typename TKey , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<TKey>, typename TTreeSet = TreeSet<TKey, TreeTraitsStd<TKey, TLessFunc, true>, MemManagerStd<TAllocator>>>
template<typename ValueFilter >
size_type erase_if ( multiset< TKey, TLessFunc, TAllocator, TTreeSet > &  cont,
const ValueFilter &  valueFilter 
)
friend

◆ swap

template<typename TKey , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<TKey>, typename TTreeSet = TreeSet<TKey, TreeTraitsStd<TKey, TLessFunc, true>, MemManagerStd<TAllocator>>>
void swap ( multiset< TKey, TLessFunc, TAllocator, TTreeSet > &  left,
multiset< TKey, TLessFunc, TAllocator, TTreeSet > &  right 
)
friend

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