Classes | Public Types | Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
vbl_batch_multimap< K, T, C > Class Template Reference

A fast read and batch-write map-style collection. More...

#include <vbl_batch_multimap.h>

Classes

class  value_compare_t
 

Public Types

typedef K key_type
 
typedef T mapped_type
 
typedef std::pair< key_type, mapped_typevalue_type
 
typedef C key_compare
 
typedef std::vector< value_typecontainer_type
 
typedef container_type::allocator_type allocator_type
 
typedef container_type::const_iterator const_iterator
 
typedef container_type::const_reference const_reference
 

Public Member Functions

 vbl_batch_multimap ()
 
template<typename CI >
 vbl_batch_multimap (CI start, CI finish)
 
template<typename CI >
void assign (CI start, CI finish)
 Change all the values in the multimap. More...
 
template<typename CI >
void assign_sorted (CI start, CI finish)
 Change all the values in the multimap, to a ready sorted sequence. More...
 
void swap (vbl_batch_multimap &rhs)
 
bool operator== (const vbl_batch_multimap &rhs)
 
const_iterator begin () const
 
const_iterator end () const
 
bool empty () const
 
std::size_t size () const
 
const_iterator lower_bound (const key_type &key) const
 Finds the beginning of a subsequence matching given key. More...
 
const_iterator upper_bound (const key_type &key) const
 Finds the one past the end of a subsequence matching given key. More...
 
std::pair< const_iterator, const_iteratorequal_range (const key_type &key) const
 A more efficient make_pair(lower_bound(...), upper_bound(...)). More...
 
const_iterator find (const key_type &key) const
 Finds the first matching value in the sequence, or returns end() if no match,. More...
 
std::size_t count (const key_type &key) const
 Finds the number of elements with matching key,. More...
 

Static Private Member Functions

template<typename CI , typename CMP >
static bool is_sorted (CI start, CI end, CMP comp)
 

Private Attributes

container_type data_
 

Detailed Description

template<typename K, typename T, typename C = std::less<K>>
class vbl_batch_multimap< K, T, C >

A fast read and batch-write map-style collection.

This container stores its elements in a single vector, and has fast construction and deletion. It has all the const-access map fundtions, but its contents can only be modified all-at-once.

Definition at line 29 of file vbl_batch_multimap.h.

Member Typedef Documentation

◆ allocator_type

template<typename K, typename T, typename C = std::less<K>>
typedef container_type::allocator_type vbl_batch_multimap< K, T, C >::allocator_type

Definition at line 37 of file vbl_batch_multimap.h.

◆ const_iterator

template<typename K, typename T, typename C = std::less<K>>
typedef container_type::const_iterator vbl_batch_multimap< K, T, C >::const_iterator

Definition at line 39 of file vbl_batch_multimap.h.

◆ const_reference

template<typename K, typename T, typename C = std::less<K>>
typedef container_type::const_reference vbl_batch_multimap< K, T, C >::const_reference

Definition at line 41 of file vbl_batch_multimap.h.

◆ container_type

template<typename K, typename T, typename C = std::less<K>>
typedef std::vector<value_type> vbl_batch_multimap< K, T, C >::container_type

Definition at line 36 of file vbl_batch_multimap.h.

◆ key_compare

template<typename K, typename T, typename C = std::less<K>>
typedef C vbl_batch_multimap< K, T, C >::key_compare

Definition at line 35 of file vbl_batch_multimap.h.

◆ key_type

template<typename K, typename T, typename C = std::less<K>>
typedef K vbl_batch_multimap< K, T, C >::key_type

Definition at line 32 of file vbl_batch_multimap.h.

◆ mapped_type

template<typename K, typename T, typename C = std::less<K>>
typedef T vbl_batch_multimap< K, T, C >::mapped_type

Definition at line 33 of file vbl_batch_multimap.h.

◆ value_type

template<typename K, typename T, typename C = std::less<K>>
typedef std::pair<key_type, mapped_type> vbl_batch_multimap< K, T, C >::value_type

Definition at line 34 of file vbl_batch_multimap.h.

Constructor & Destructor Documentation

◆ vbl_batch_multimap() [1/2]

template<typename K, typename T, typename C = std::less<K>>
vbl_batch_multimap< K, T, C >::vbl_batch_multimap ( )
inline

Definition at line 64 of file vbl_batch_multimap.h.

◆ vbl_batch_multimap() [2/2]

template<typename K, typename T, typename C = std::less<K>>
template<typename CI >
vbl_batch_multimap< K, T, C >::vbl_batch_multimap ( CI  start,
CI  finish 
)
inline

Definition at line 67 of file vbl_batch_multimap.h.

Member Function Documentation

◆ assign()

template<typename K, typename T, typename C = std::less<K>>
template<typename CI >
void vbl_batch_multimap< K, T, C >::assign ( CI  start,
CI  finish 
)
inline

Change all the values in the multimap.

Definition at line 75 of file vbl_batch_multimap.h.

◆ assign_sorted()

template<typename K, typename T, typename C = std::less<K>>
template<typename CI >
void vbl_batch_multimap< K, T, C >::assign_sorted ( CI  start,
CI  finish 
)
inline

Change all the values in the multimap, to a ready sorted sequence.

The input values must already be sorted on their v.first members.

Definition at line 84 of file vbl_batch_multimap.h.

◆ begin()

template<typename K, typename T, typename C = std::less<K>>
const_iterator vbl_batch_multimap< K, T, C >::begin ( ) const
inline

Definition at line 103 of file vbl_batch_multimap.h.

◆ count()

template<typename K, typename T, typename C = std::less<K>>
std::size_t vbl_batch_multimap< K, T, C >::count ( const key_type key) const
inline

Finds the number of elements with matching key,.

Definition at line 146 of file vbl_batch_multimap.h.

◆ empty()

template<typename K, typename T, typename C = std::less<K>>
bool vbl_batch_multimap< K, T, C >::empty ( ) const
inline

Definition at line 105 of file vbl_batch_multimap.h.

◆ end()

template<typename K, typename T, typename C = std::less<K>>
const_iterator vbl_batch_multimap< K, T, C >::end ( ) const
inline

Definition at line 104 of file vbl_batch_multimap.h.

◆ equal_range()

template<typename K, typename T, typename C = std::less<K>>
std::pair<const_iterator, const_iterator> vbl_batch_multimap< K, T, C >::equal_range ( const key_type key) const
inline

A more efficient make_pair(lower_bound(...), upper_bound(...)).

Definition at line 129 of file vbl_batch_multimap.h.

◆ find()

template<typename K, typename T, typename C = std::less<K>>
const_iterator vbl_batch_multimap< K, T, C >::find ( const key_type key) const
inline

Finds the first matching value in the sequence, or returns end() if no match,.

Definition at line 136 of file vbl_batch_multimap.h.

◆ is_sorted()

template<typename K, typename T, typename C = std::less<K>>
template<typename CI , typename CMP >
static bool vbl_batch_multimap< K, T, C >::is_sorted ( CI  start,
CI  end,
CMP  comp 
)
inlinestaticprivate

Definition at line 157 of file vbl_batch_multimap.h.

◆ lower_bound()

template<typename K, typename T, typename C = std::less<K>>
const_iterator vbl_batch_multimap< K, T, C >::lower_bound ( const key_type key) const
inline

Finds the beginning of a subsequence matching given key.

/return iterator to the first element that equals key, or the next greatest element if no match is found.

Definition at line 113 of file vbl_batch_multimap.h.

◆ operator==()

template<typename K, typename T, typename C = std::less<K>>
bool vbl_batch_multimap< K, T, C >::operator== ( const vbl_batch_multimap< K, T, C > &  rhs)
inline

Definition at line 96 of file vbl_batch_multimap.h.

◆ size()

template<typename K, typename T, typename C = std::less<K>>
std::size_t vbl_batch_multimap< K, T, C >::size ( ) const
inline

Definition at line 106 of file vbl_batch_multimap.h.

◆ swap()

template<typename K, typename T, typename C = std::less<K>>
void vbl_batch_multimap< K, T, C >::swap ( vbl_batch_multimap< K, T, C > &  rhs)
inline

Definition at line 90 of file vbl_batch_multimap.h.

◆ upper_bound()

template<typename K, typename T, typename C = std::less<K>>
const_iterator vbl_batch_multimap< K, T, C >::upper_bound ( const key_type key) const
inline

Finds the one past the end of a subsequence matching given key.

/return iterator to one past the last element that equals key, or to the next greatest element if no match is found.

Definition at line 122 of file vbl_batch_multimap.h.

Member Data Documentation

◆ data_

template<typename K, typename T, typename C = std::less<K>>
container_type vbl_batch_multimap< K, T, C >::data_
private

Definition at line 154 of file vbl_batch_multimap.h.


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