A fast read and batch-write map-style collection. More...
#include <vbl_batch_compact_multimap.h>
Classes | |
class | input_compare |
A comparator to sort input data, by ignoring the value in pair<key, value>. More... | |
Public Types | |
typedef K | key_type |
typedef T | value_type |
typedef vcl_pair< key_type, value_type > | input_type |
The type of data in the inputted sequence. | |
typedef C | key_compare |
typedef unsigned | index_type |
typedef vcl_vector< key_type > | key_container_type |
typedef vcl_vector< index_type > | index_container_type |
typedef vcl_vector< value_type > | value_container_type |
typedef key_container_type::const_iterator | const_key_iterator |
typedef value_container_type::const_iterator | const_value_iterator |
Public Member Functions | |
vbl_batch_compact_multimap () | |
template<typename CI > | |
vbl_batch_compact_multimap (CI start, CI finish) | |
template<typename CI > | |
void | assign (CI start, CI finish) |
Change all the values in the multimap. | |
template<typename CI > | |
void | assign_sorted (CI start, CI finish) |
Change all the values in the multimap, to a ready sorted sequence. | |
void | swap (vbl_batch_compact_multimap &x) |
bool | operator== (const vbl_batch_compact_multimap &rhs) |
const_key_iterator | keys_begin () const |
const_key_iterator | keys_end () const |
const_value_iterator | values_begin () const |
const_value_iterator | values_end () const |
bool | empty () const |
vcl_size_t | size () const |
const_value_iterator | lower_bound (const key_type &x) const |
Finds the beginning of a subsequence of values whose key matches given x . | |
const_value_iterator | upper_bound (const key_type &x) const |
Finds the one past the end of a subsequence of values whose key matches given x . | |
vcl_pair< const_value_iterator, const_value_iterator > | equal_range (const key_type &x) const |
A more efficient make_pair(lower_bound(...), upper_bound(...)). | |
const_value_iterator | find (const key_type &x) const |
Finds the first value with key matching x , or returns values_end() if no match,. | |
vcl_size_t | count (const key_type &x) const |
Finds the number of values matching key x ,. | |
Protected Types | |
typedef vcl_vector< input_type > | input_container_type |
The type of container used internally to process inputted data. | |
Private Member Functions | |
template<typename CI , typename CMP > | |
bool | is_sorted (CI start, CI end, CMP comp) |
Private Attributes | |
key_container_type | keys_ |
index_container_type | indices_ |
value_container_type | values_ |
A fast read and batch-write map-style collection.
This container stores its keys separately from its values, and has fast construction and deletion. It has all the const-access map fundtions, but its contents can only be modified all-at-once. You can not get a key,value pair, but you can get access to all the compactly-stored values for a given key.
Definition at line 24 of file vbl_batch_compact_multimap.h.
typedef key_container_type::const_iterator vbl_batch_compact_multimap< K, T, C >::const_key_iterator |
Definition at line 37 of file vbl_batch_compact_multimap.h.
typedef value_container_type::const_iterator vbl_batch_compact_multimap< K, T, C >::const_value_iterator |
Definition at line 38 of file vbl_batch_compact_multimap.h.
typedef vcl_vector<index_type> vbl_batch_compact_multimap< K, T, C >::index_container_type |
Definition at line 34 of file vbl_batch_compact_multimap.h.
typedef unsigned vbl_batch_compact_multimap< K, T, C >::index_type |
Definition at line 32 of file vbl_batch_compact_multimap.h.
typedef vcl_vector<input_type> vbl_batch_compact_multimap< K, T, C >::input_container_type [protected] |
The type of container used internally to process inputted data.
Definition at line 42 of file vbl_batch_compact_multimap.h.
typedef vcl_pair<key_type, value_type> vbl_batch_compact_multimap< K, T, C >::input_type |
The type of data in the inputted sequence.
Definition at line 30 of file vbl_batch_compact_multimap.h.
typedef C vbl_batch_compact_multimap< K, T, C >::key_compare |
Definition at line 31 of file vbl_batch_compact_multimap.h.
typedef vcl_vector<key_type> vbl_batch_compact_multimap< K, T, C >::key_container_type |
Definition at line 33 of file vbl_batch_compact_multimap.h.
typedef K vbl_batch_compact_multimap< K, T, C >::key_type |
Definition at line 27 of file vbl_batch_compact_multimap.h.
typedef vcl_vector<value_type> vbl_batch_compact_multimap< K, T, C >::value_container_type |
Definition at line 35 of file vbl_batch_compact_multimap.h.
typedef T vbl_batch_compact_multimap< K, T, C >::value_type |
Definition at line 28 of file vbl_batch_compact_multimap.h.
vbl_batch_compact_multimap< K, T, C >::vbl_batch_compact_multimap | ( | ) | [inline] |
Definition at line 60 of file vbl_batch_compact_multimap.h.
vbl_batch_compact_multimap< K, T, C >::vbl_batch_compact_multimap | ( | CI | start, |
CI | finish | ||
) | [inline] |
Definition at line 63 of file vbl_batch_compact_multimap.h.
void vbl_batch_compact_multimap< K, T, C >::assign | ( | CI | start, |
CI | finish | ||
) | [inline] |
Change all the values in the multimap.
Definition at line 72 of file vbl_batch_compact_multimap.h.
void vbl_batch_compact_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 82 of file vbl_batch_compact_multimap.h.
vcl_size_t vbl_batch_compact_multimap< K, T, C >::count | ( | const key_type & | x | ) | const [inline] |
Finds the number of values matching key x
,.
Definition at line 182 of file vbl_batch_compact_multimap.h.
bool vbl_batch_compact_multimap< K, T, C >::empty | ( | ) | const [inline] |
Definition at line 122 of file vbl_batch_compact_multimap.h.
vcl_pair<const_value_iterator, const_value_iterator> vbl_batch_compact_multimap< K, T, C >::equal_range | ( | const key_type & | x | ) | const [inline] |
A more efficient make_pair(lower_bound(...), upper_bound(...)).
Definition at line 150 of file vbl_batch_compact_multimap.h.
const_value_iterator vbl_batch_compact_multimap< K, T, C >::find | ( | const key_type & | x | ) | const [inline] |
Finds the first value with key matching x
, or returns values_end() if no match,.
Definition at line 170 of file vbl_batch_compact_multimap.h.
bool vbl_batch_compact_multimap< K, T, C >::is_sorted | ( | CI | start, |
CI | end, | ||
CMP | comp | ||
) | [inline, private] |
Definition at line 199 of file vbl_batch_compact_multimap.h.
const_key_iterator vbl_batch_compact_multimap< K, T, C >::keys_begin | ( | ) | const [inline] |
Definition at line 118 of file vbl_batch_compact_multimap.h.
const_key_iterator vbl_batch_compact_multimap< K, T, C >::keys_end | ( | ) | const [inline] |
Definition at line 119 of file vbl_batch_compact_multimap.h.
const_value_iterator vbl_batch_compact_multimap< K, T, C >::lower_bound | ( | const key_type & | x | ) | const [inline] |
Finds the beginning of a subsequence of values whose key matches given x
.
x
, or the next greatest element if no match is found. Definition at line 130 of file vbl_batch_compact_multimap.h.
bool vbl_batch_compact_multimap< K, T, C >::operator== | ( | const vbl_batch_compact_multimap< K, T, C > & | rhs | ) | [inline] |
Definition at line 109 of file vbl_batch_compact_multimap.h.
vcl_size_t vbl_batch_compact_multimap< K, T, C >::size | ( | ) | const [inline] |
Definition at line 123 of file vbl_batch_compact_multimap.h.
void vbl_batch_compact_multimap< K, T, C >::swap | ( | vbl_batch_compact_multimap< K, T, C > & | x | ) | [inline] |
Definition at line 102 of file vbl_batch_compact_multimap.h.
const_value_iterator vbl_batch_compact_multimap< K, T, C >::upper_bound | ( | const key_type & | x | ) | const [inline] |
Finds the one past the end of a subsequence of values whose key matches given x
.
key
, or to the next greatest element if no match is found. Definition at line 141 of file vbl_batch_compact_multimap.h.
const_value_iterator vbl_batch_compact_multimap< K, T, C >::values_begin | ( | ) | const [inline] |
Definition at line 120 of file vbl_batch_compact_multimap.h.
const_value_iterator vbl_batch_compact_multimap< K, T, C >::values_end | ( | ) | const [inline] |
Definition at line 121 of file vbl_batch_compact_multimap.h.
index_container_type vbl_batch_compact_multimap< K, T, C >::indices_ [private] |
Definition at line 195 of file vbl_batch_compact_multimap.h.
key_container_type vbl_batch_compact_multimap< K, T, C >::keys_ [private] |
Definition at line 194 of file vbl_batch_compact_multimap.h.
value_container_type vbl_batch_compact_multimap< K, T, C >::values_ [private] |
Definition at line 196 of file vbl_batch_compact_multimap.h.