Main MRPT website > C++ reference for MRPT 1.9.9
List of all members | Private Attributes
mrpt::containers::map_traits_map_as_vector::map< KEY, VALUE, _LessPred, _Alloc > Struct Template Reference

Detailed Description

template<class KEY, class VALUE, class _LessPred = std::less<KEY>, class _Alloc = mrpt::aligned_allocator_cpp11<std::pair<const KEY, VALUE>>>
struct mrpt::containers::map_traits_map_as_vector::map< KEY, VALUE, _LessPred, _Alloc >

Definition at line 44 of file traits_map.h.

#include <mrpt/containers/traits_map.h>

Inheritance diagram for mrpt::containers::map_traits_map_as_vector::map< KEY, VALUE, _LessPred, _Alloc >:
Inheritance graph

Public Member Functions

Constructors, read/write access and other operations
size_t size () const
 
bool empty () const
 
size_type count (const key_type i) const
 Count how many entries have a given key value - unlike std::map<K,V>, recall that this class will say an element i<N-1 exists just due to an insertion of element at N. More...
 
size_type max_size () const
 Maximum size due to system limits. More...
 
const vec_tgetVector () const
 Return a read-only reference to the internal vector. More...
 
void clear ()
 Clear the contents of this container. More...
 
void swap (map_as_vector< KEY, VALUE > &o)
 Efficient swap with another object. More...
 
VALUE & operator[] (const size_t i)
 Write/read via [i] operator, that creates all elements up to (and including) the i'th if they didn't exist already. More...
 
void insert (const iterator &guess_point, const value_type &keyvalpair)
 Insert pair<key,val>, as in std::map (guess_point is actually ignored in this class) More...
 
void insert (const value_type &keyvalpair)
 Insert pair<key,val>, as in std::map. More...
 
iterator find (const size_t i)
 Constant-time find, returning an iterator to the <key,val> pair or to end() if not found (that is, if it's above the maximum index in the vector) More...
 
const_iterator find (const size_t i) const
 Constant-time find, returning an iterator to the <key,val> pair or to end() if not found (that is, if it's above the maximum index in the vector) More...
 

Private Attributes

vec_t m_vec
 The actual container. More...
 

Iterators stuff and other types

using key_type = KEY
 
using value_type = std::pair< KEY, VALUE >
 
using vec_t = typename mrpt::aligned_std_vector< std::pair< KEY, VALUE >>
 
using size_type = typename vec_t::size_type
 
using iterator = typename vec_t::iterator
 
using const_iterator = typename vec_t::const_iterator
 
using reverse_iterator = std::reverse_iterator< iterator >
 
using const_reverse_iterator = std::reverse_iterator< const_iterator >
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 

Member Typedef Documentation

◆ const_iterator

using mrpt::containers::map_as_vector< KEY, VALUE, typename mrpt::aligned_std_vector<std::pair<KEY, VALUE>> >::const_iterator = typename vec_t::const_iterator
inherited

Definition at line 69 of file map_as_vector.h.

◆ const_reverse_iterator

using mrpt::containers::map_as_vector< KEY, VALUE, typename mrpt::aligned_std_vector<std::pair<KEY, VALUE>> >::const_reverse_iterator = std::reverse_iterator<const_iterator>
inherited

Definition at line 71 of file map_as_vector.h.

◆ iterator

using mrpt::containers::map_as_vector< KEY, VALUE, typename mrpt::aligned_std_vector<std::pair<KEY, VALUE>> >::iterator = typename vec_t::iterator
inherited

Definition at line 68 of file map_as_vector.h.

◆ key_type

using mrpt::containers::map_as_vector< KEY, VALUE, typename mrpt::aligned_std_vector<std::pair<KEY, VALUE>> >::key_type = KEY
inherited

Definition at line 64 of file map_as_vector.h.

◆ reverse_iterator

using mrpt::containers::map_as_vector< KEY, VALUE, typename mrpt::aligned_std_vector<std::pair<KEY, VALUE>> >::reverse_iterator = std::reverse_iterator<iterator>
inherited

Definition at line 70 of file map_as_vector.h.

◆ size_type

using mrpt::containers::map_as_vector< KEY, VALUE, typename mrpt::aligned_std_vector<std::pair<KEY, VALUE>> >::size_type = typename vec_t::size_type
inherited

Definition at line 67 of file map_as_vector.h.

◆ value_type

using mrpt::containers::map_as_vector< KEY, VALUE, typename mrpt::aligned_std_vector<std::pair<KEY, VALUE>> >::value_type = std::pair<KEY, VALUE>
inherited

Definition at line 65 of file map_as_vector.h.

◆ vec_t

using mrpt::containers::map_as_vector< KEY, VALUE, typename mrpt::aligned_std_vector<std::pair<KEY, VALUE>> >::vec_t = typename mrpt::aligned_std_vector<std::pair<KEY, VALUE>>
inherited

Definition at line 66 of file map_as_vector.h.

Member Function Documentation

◆ begin() [1/2]

iterator mrpt::containers::map_as_vector< KEY, VALUE, typename mrpt::aligned_std_vector<std::pair<KEY, VALUE>> >::begin
inlineinherited

Definition at line 73 of file map_as_vector.h.

◆ begin() [2/2]

const_iterator mrpt::containers::map_as_vector< KEY, VALUE, typename mrpt::aligned_std_vector<std::pair<KEY, VALUE>> >::begin
inlineinherited

Definition at line 75 of file map_as_vector.h.

◆ clear()

void mrpt::containers::map_as_vector< KEY, VALUE, typename mrpt::aligned_std_vector<std::pair<KEY, VALUE>> >::clear
inlineinherited

Clear the contents of this container.

Definition at line 114 of file map_as_vector.h.

◆ count()

size_type mrpt::containers::map_as_vector< KEY, VALUE, typename mrpt::aligned_std_vector<std::pair<KEY, VALUE>> >::count ( const key_type  i) const
inlineinherited

Count how many entries have a given key value - unlike std::map<K,V>, recall that this class will say an element i<N-1 exists just due to an insertion of element at N.

Definition at line 104 of file map_as_vector.h.

◆ empty()

bool mrpt::containers::map_as_vector< KEY, VALUE, typename mrpt::aligned_std_vector<std::pair<KEY, VALUE>> >::empty
inlineinherited

Definition at line 100 of file map_as_vector.h.

◆ end() [1/2]

iterator mrpt::containers::map_as_vector< KEY, VALUE, typename mrpt::aligned_std_vector<std::pair<KEY, VALUE>> >::end
inlineinherited

Definition at line 74 of file map_as_vector.h.

◆ end() [2/2]

const_iterator mrpt::containers::map_as_vector< KEY, VALUE, typename mrpt::aligned_std_vector<std::pair<KEY, VALUE>> >::end
inlineinherited

Definition at line 76 of file map_as_vector.h.

◆ find() [1/2]

iterator mrpt::containers::map_as_vector< KEY, VALUE, typename mrpt::aligned_std_vector<std::pair<KEY, VALUE>> >::find ( const size_t  i)
inlineinherited

Constant-time find, returning an iterator to the <key,val> pair or to end() if not found (that is, if it's above the maximum index in the vector)

Definition at line 142 of file map_as_vector.h.

◆ find() [2/2]

const_iterator mrpt::containers::map_as_vector< KEY, VALUE, typename mrpt::aligned_std_vector<std::pair<KEY, VALUE>> >::find ( const size_t  i) const
inlineinherited

Constant-time find, returning an iterator to the <key,val> pair or to end() if not found (that is, if it's above the maximum index in the vector)

Definition at line 152 of file map_as_vector.h.

◆ getVector()

const vec_t& mrpt::containers::map_as_vector< KEY, VALUE, typename mrpt::aligned_std_vector<std::pair<KEY, VALUE>> >::getVector
inlineinherited

Return a read-only reference to the internal vector.

Definition at line 112 of file map_as_vector.h.

◆ insert() [1/2]

void mrpt::containers::map_as_vector< KEY, VALUE, typename mrpt::aligned_std_vector<std::pair<KEY, VALUE>> >::insert ( const iterator guess_point,
const value_type keyvalpair 
)
inlineinherited

Insert pair<key,val>, as in std::map (guess_point is actually ignored in this class)

Definition at line 128 of file map_as_vector.h.

◆ insert() [2/2]

void mrpt::containers::map_as_vector< KEY, VALUE, typename mrpt::aligned_std_vector<std::pair<KEY, VALUE>> >::insert ( const value_type keyvalpair)
inlineinherited

Insert pair<key,val>, as in std::map.

Definition at line 134 of file map_as_vector.h.

◆ max_size()

size_type mrpt::containers::map_as_vector< KEY, VALUE, typename mrpt::aligned_std_vector<std::pair<KEY, VALUE>> >::max_size
inlineinherited

Maximum size due to system limits.

Definition at line 110 of file map_as_vector.h.

◆ operator[]()

VALUE& mrpt::containers::map_as_vector< KEY, VALUE, typename mrpt::aligned_std_vector<std::pair<KEY, VALUE>> >::operator[] ( const size_t  i)
inlineinherited

Write/read via [i] operator, that creates all elements up to (and including) the i'th if they didn't exist already.

Definition at line 119 of file map_as_vector.h.

◆ rbegin() [1/2]

reverse_iterator mrpt::containers::map_as_vector< KEY, VALUE, typename mrpt::aligned_std_vector<std::pair<KEY, VALUE>> >::rbegin
inlineinherited

Definition at line 77 of file map_as_vector.h.

◆ rbegin() [2/2]

const_reverse_iterator mrpt::containers::map_as_vector< KEY, VALUE, typename mrpt::aligned_std_vector<std::pair<KEY, VALUE>> >::rbegin
inlineinherited

Definition at line 78 of file map_as_vector.h.

◆ rend() [1/2]

reverse_iterator mrpt::containers::map_as_vector< KEY, VALUE, typename mrpt::aligned_std_vector<std::pair<KEY, VALUE>> >::rend
inlineinherited

Definition at line 82 of file map_as_vector.h.

◆ rend() [2/2]

const_reverse_iterator mrpt::containers::map_as_vector< KEY, VALUE, typename mrpt::aligned_std_vector<std::pair<KEY, VALUE>> >::rend
inlineinherited

Definition at line 83 of file map_as_vector.h.

◆ size()

size_t mrpt::containers::map_as_vector< KEY, VALUE, typename mrpt::aligned_std_vector<std::pair<KEY, VALUE>> >::size
inlineinherited

Definition at line 99 of file map_as_vector.h.

◆ swap()

void mrpt::containers::map_as_vector< KEY, VALUE, typename mrpt::aligned_std_vector<std::pair<KEY, VALUE>> >::swap ( map_as_vector< KEY, VALUE > &  o)
inlineinherited

Efficient swap with another object.

Definition at line 116 of file map_as_vector.h.

Member Data Documentation

◆ m_vec

vec_t mrpt::containers::map_as_vector< KEY, VALUE, typename mrpt::aligned_std_vector<std::pair<KEY, VALUE>> >::m_vec
privateinherited

The actual container.

Definition at line 90 of file map_as_vector.h.




Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST