TalanSoft Toolkits  201707
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Types | Public Member Functions | Public Attributes | List of all members
vector_map< K, V,, > Class Template Reference
Inheritance diagram for vector_map< K, V,, >:
vector< pair< K, V >, _Alloc >

Detailed Description

template<typename K, typename V, __DFL_TMPL_PARAM(CMP, less< K >), ASTL_DEFAULT_PAIR_ALLOCATOR_SELECT(vector_map, K, V)>
class astl::vector_map< K, V,, >

Associative container based on a vector.

Remarks
Insertion is slow, the main advantage of this map is that it can be serialized in one shot as would a regular vector.

Public Types

typedef K key_type
 
typedef V data_type
 
typedef const K & const_key_ref
 
typedef const V & const_data_ref
 
typedef const vector_map< K, V,
CMP, _Alloc > & 
rcself_t
 
typedef vector< pair< K, V >
, _Alloc > 
base_class
 
typedef base_class::value_type value_type
 
typedef base_class::size_type size_type
 
typedef base_class::pointer pointer
 
typedef base_class::const_pointer const_pointer
 
typedef base_class::reference reference
 
typedef base_class::const_reference const_reference
 
typedef base_class::const_iterator const_iterator
 
typedef base_class::iterator iterator
 
typedef
base_class::reverse_iterator 
reverse_iterator
 
typedef
base_class::const_reverse_iterator 
const_reverse_iterator
 
typedef pair< const_iterator,
const_iterator
const_range_t
 
typedef pair< iterator, iteratorrange_t
 
- Public Types inherited from vector< pair< K, V >, _Alloc >
typedef pair< K, V > value_type
 
typedef value_typepointer
 
typedef const value_typeconst_pointer
 
typedef value_typeiterator
 
typedef const value_typeconst_iterator
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
typedef size_t size_type
 
typedef ptrdiff_t difference_type
 
typedef random_access_iterator_tag _Iterator_category
 
typedef _Vector_base< pair< K,
V >, _Alloc >::allocator_type 
allocator_type
 

Public Member Functions

 vector_map (void)
 
 vector_map (size_type n)
 
 vector_map (rcself_t v)
 
 vector_map (const_iterator i1, const_iterator i2)
 
rcself_t operator= (rcself_t v)
 
const_data_ref operator[] (const_key_ref k) const
 Returns data associated with key k. More...
 
data_typeoperator[] (const_key_ref k)
 Returns data associated with key k. More...
 
void reserve (size_t count)
 Reserve space for some data. More...
 
size_type size (void) const
 
iterator begin (void)
 
const_iterator begin (void) const
 
iterator end (void)
 
const_iterator end (void) const
 
void assign (const_iterator i1, const_iterator i2)
 
void push_back (const_reference v)
 
const_iterator find (const_key_ref k) const
 Returns the pair<K,V> where K = k. More...
 
iterator find (const_key_ref k)
 
const_iterator find_data (const_data_ref v, const_iterator first=NULL, const_iterator last=NULL) const
 Returns the pair<K,V> where V = v, occuring in range [first,last). More...
 
iterator find_data (const_data_ref v, iterator first=NULL, iterator last=NULL)
 Returns the pair<K,V> where V = v, occuring in range [first,last). More...
 
pair< iterator, bool > insert (const_reference v)
 Inserts the pair into the container. More...
 
void insert (const_iterator i1, const_iterator i2)
 Inserts elements from range [i1,i2) into the container. More...
 
void erase (const_key_ref k)
 Erases the element with key value k. More...
 
iterator erase (iterator ep)
 
iterator erase (iterator ep1, iterator ep2)
 
void clear (void)
 
const_iterator lower_bound (const_key_ref k) const
 
iterator lower_bound (const_key_ref k)
 
const key_typeat_first (const tInt aIndex) const
 
data_typeat_second (const tInt aIndex)
 
const data_typeat_second (const tInt aIndex) const
 
- Public Member Functions inherited from vector< pair< K, V >, _Alloc >
allocator_type get_allocator () const
 
__forceinline iterator begin ()
 
__forceinline const_iterator begin () const
 
__forceinline iterator end ()
 
__forceinline const_iterator end () const
 
__forceinline iterator itat (size_type aIndex)
 
__forceinline const_iterator itat (size_type aIndex) const
 
__forceinline reverse_iterator rbegin ()
 
__forceinline
const_reverse_iterator 
rbegin () const
 
__forceinline reverse_iterator rend ()
 
__forceinline
const_reverse_iterator 
rend () const
 
__forceinline size_type size () const
 
__forceinline size_type max_size () const
 
__forceinline size_type capacity () const
 
__forceinline bool empty () const
 
__forceinline reference operator[] (size_type __n)
 
__forceinline const_reference operator[] (size_type __n) const
 
__forceinline reference front ()
 
__forceinline const_reference front () const
 
__forceinline reference back ()
 
__forceinline const_reference back () const
 
__noinline reference at (size_type __n)
 
__noinline const_reference at (size_type __n) const
 
__forceinline reference top ()
 
__forceinline const_reference top () const
 
__forceinline void insert_at (unsigned int idx, const pair< K, V > &val)
 
__forceinline void remove_at (unsigned int idx)
 
__noinline vector (const allocator_type &__a=allocator_type())
 
__noinline vector (size_type __n, const pair< K, V > &__val, const allocator_type &__a=allocator_type())
 
__noinline vector (size_type __n)
 
__noinline vector (const vector< pair< K, V >, _Alloc > &__x)
 
__noinline vector (const pair< K, V > *__first, const pair< K, V > *__last, const allocator_type &__a=allocator_type())
 
__noinline ~vector ()
 
__noinline vector< pair< K, V >
, _Alloc > & 
operator= (const vector< pair< K, V >, _Alloc > &__x)
 
__noinline void reserve (size_type __n)
 
void assign (size_type __n, const pair< K, V > &__val)
 
void assign (const_iterator __first, const_iterator __last)
 
__forceinline pair< K, V > & push_back (const pair< K, V > &__x)
 
reference push_back ()
 
__noinline void swap (vector< pair< K, V >, _Alloc > &__x)
 
__noinline iterator insert (iterator __position, const pair< K, V > &__x)
 
iterator insert (iterator __position)
 
void insert (iterator __position, const_iterator __first, const_iterator __last)
 
void insert (iterator __pos, size_type __n, const pair< K, V > &__x)
 
__forceinline void pop_back ()
 
__noinline iterator erase (iterator __position)
 
__noinline iterator erase (iterator __first, iterator __last)
 
__noinline void resize (size_type __new_size, const pair< K, V > &__x)
 
__forceinline void resize (size_type __new_size)
 
__forceinline void clear ()
 

Public Attributes

CMP _key_compare
 
- Public Attributes inherited from vector< pair< K, V >, _Alloc >
 ASTL_DECLARE_RANDOM_ACCESS_REVERSE_ITERATORS
 

Additional Inherited Members

- Protected Types inherited from vector< pair< K, V >, _Alloc >
typedef __type_traits< pair< K,
V >
>::has_trivial_assignment_operator 
_TrivialAss
 
typedef __type_traits< pair< K,
V >
>::has_trivial_assignment_operator 
_IsPODType
 

Member Typedef Documentation

typedef K key_type
typedef V data_type
typedef const K& const_key_ref
typedef const V& const_data_ref
typedef const vector_map<K,V,CMP,_Alloc>& rcself_t
typedef vector<pair<K,V>,_Alloc> base_class
typedef base_class::reverse_iterator reverse_iterator
typedef base_class::const_reverse_iterator const_reverse_iterator

Constructor & Destructor Documentation

vector_map ( size_type  n)
explicit

Member Function Documentation

rcself_t operator= ( rcself_t  v)
const_data_ref operator[] ( const_key_ref  k) const

Returns data associated with key k.

data_type& operator[] ( const_key_ref  k)

Returns data associated with key k.

void reserve ( size_t  count)

Reserve space for some data.

size_type size ( void  ) const
iterator begin ( void  )
const_iterator begin ( void  ) const
iterator end ( void  )
const_iterator end ( void  ) const
void assign ( const_iterator  i1,
const_iterator  i2 
)
void push_back ( const_reference  v)
const_iterator find ( const_key_ref  k) const

Returns the pair<K,V> where K = k.

iterator find ( const_key_ref  k)
const_iterator find_data ( const_data_ref  v,
const_iterator  first = NULL,
const_iterator  last = NULL 
) const

Returns the pair<K,V> where V = v, occuring in range [first,last).

iterator find_data ( const_data_ref  v,
iterator  first = NULL,
iterator  last = NULL 
)

Returns the pair<K,V> where V = v, occuring in range [first,last).

pair<iterator,bool> insert ( const_reference  v)

Inserts the pair into the container.

void insert ( const_iterator  i1,
const_iterator  i2 
)

Inserts elements from range [i1,i2) into the container.

void erase ( const_key_ref  k)

Erases the element with key value k.

iterator erase ( iterator  ep)
iterator erase ( iterator  ep1,
iterator  ep2 
)
void clear ( void  )
const_iterator lower_bound ( const_key_ref  k) const
iterator lower_bound ( const_key_ref  k)
const key_type& at_first ( const tInt  aIndex) const
data_type& at_second ( const tInt  aIndex)
const data_type& at_second ( const tInt  aIndex) const

Member Data Documentation

CMP _key_compare