Classes | Public Types | Public Member Functions | Protected Types | Private Member Functions | Private Attributes
vbl_batch_compact_multimap< K, T, C > Class Template Reference

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

#include <vbl_batch_compact_multimap.h>

List of all members.

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_typekey_container_type
typedef vcl_vector< index_typeindex_container_type
typedef vcl_vector< value_typevalue_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_typeinput_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_

Detailed Description

template<typename K, typename T, typename C = vcl_less<K>>
class vbl_batch_compact_multimap< K, T, C >

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.


Member Typedef Documentation

template<typename K, typename T, typename C = vcl_less<K>>
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.

template<typename K, typename T, typename C = vcl_less<K>>
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.

template<typename K, typename T, typename C = vcl_less<K>>
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.

template<typename K, typename T, typename C = vcl_less<K>>
typedef unsigned vbl_batch_compact_multimap< K, T, C >::index_type

Definition at line 32 of file vbl_batch_compact_multimap.h.

template<typename K, typename T, typename C = vcl_less<K>>
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.

template<typename K, typename T, typename C = vcl_less<K>>
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.

template<typename K, typename T, typename C = vcl_less<K>>
typedef C vbl_batch_compact_multimap< K, T, C >::key_compare

Definition at line 31 of file vbl_batch_compact_multimap.h.

template<typename K, typename T, typename C = vcl_less<K>>
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.

template<typename K, typename T, typename C = vcl_less<K>>
typedef K vbl_batch_compact_multimap< K, T, C >::key_type

Definition at line 27 of file vbl_batch_compact_multimap.h.

template<typename K, typename T, typename C = vcl_less<K>>
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.

template<typename K, typename T, typename C = vcl_less<K>>
typedef T vbl_batch_compact_multimap< K, T, C >::value_type

Definition at line 28 of file vbl_batch_compact_multimap.h.


Constructor & Destructor Documentation

template<typename K, typename T, typename C = vcl_less<K>>
vbl_batch_compact_multimap< K, T, C >::vbl_batch_compact_multimap ( ) [inline]

Definition at line 60 of file vbl_batch_compact_multimap.h.

template<typename K, typename T, typename C = vcl_less<K>>
template<typename CI >
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.


Member Function Documentation

template<typename K, typename T, typename C = vcl_less<K>>
template<typename CI >
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.

template<typename K, typename T, typename C = vcl_less<K>>
template<typename CI >
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.

template<typename K, typename T, typename C = vcl_less<K>>
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.

template<typename K, typename T, typename C = vcl_less<K>>
bool vbl_batch_compact_multimap< K, T, C >::empty ( ) const [inline]

Definition at line 122 of file vbl_batch_compact_multimap.h.

template<typename K, typename T, typename C = vcl_less<K>>
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.

template<typename K, typename T, typename C = vcl_less<K>>
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.

template<typename K, typename T, typename C = vcl_less<K>>
template<typename CI , typename CMP >
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.

template<typename K, typename T, typename C = vcl_less<K>>
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.

template<typename K, typename T, typename C = vcl_less<K>>
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.

template<typename K, typename T, typename C = vcl_less<K>>
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.

Returns:
iterator to the first value whose key matches x, or the next greatest element if no match is found.

Definition at line 130 of file vbl_batch_compact_multimap.h.

template<typename K, typename T, typename C = vcl_less<K>>
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.

template<typename K, typename T, typename C = vcl_less<K>>
vcl_size_t vbl_batch_compact_multimap< K, T, C >::size ( ) const [inline]

Definition at line 123 of file vbl_batch_compact_multimap.h.

template<typename K, typename T, typename C = vcl_less<K>>
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.

template<typename K, typename T, typename C = vcl_less<K>>
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.

Returns:
iterator to one past the last value whose key that matches key, or to the next greatest element if no match is found.

Definition at line 141 of file vbl_batch_compact_multimap.h.

template<typename K, typename T, typename C = vcl_less<K>>
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.

template<typename K, typename T, typename C = vcl_less<K>>
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.


Member Data Documentation

template<typename K, typename T, typename C = vcl_less<K>>
index_container_type vbl_batch_compact_multimap< K, T, C >::indices_ [private]

Definition at line 195 of file vbl_batch_compact_multimap.h.

template<typename K, typename T, typename C = vcl_less<K>>
key_container_type vbl_batch_compact_multimap< K, T, C >::keys_ [private]

Definition at line 194 of file vbl_batch_compact_multimap.h.

template<typename K, typename T, typename C = vcl_less<K>>
value_container_type vbl_batch_compact_multimap< K, T, C >::values_ [private]

Definition at line 196 of file vbl_batch_compact_multimap.h.


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