Main MRPT website > C++ reference for MRPT 1.5.7
Classes | Namespaces | Functions | Variables
ts_hash_map.h File Reference
#include <mrpt/utils/compiler_fixes.h>
#include <mrpt/utils/mrpt_macros.h>
#include <mrpt/utils/integer_select.h>
#include <mrpt/utils/CArray.h>
Include dependency graph for ts_hash_map.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mrpt::utils::ts_map_entry< KEY, VALUE >
 

Namespaces

 mrpt
 This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
 
 mrpt::utils
 Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
 

Functions

void BASE_IMPEXP mrpt::utils::reduced_hash (const std::string &value, uint8_t &hash)
 hash function used by ts_hash_map. Uses dbj2 method More...
 
void BASE_IMPEXP mrpt::utils::reduced_hash (const std::string &value, uint16_t &hash)
 hash function used by ts_hash_map. Uses dbj2 method More...
 
void BASE_IMPEXP mrpt::utils::reduced_hash (const std::string &value, uint32_t &hash)
 hash function used by ts_hash_map. Uses dbj2 method More...
 
void BASE_IMPEXP mrpt::utils::reduced_hash (const std::string &value, uint64_t &hash)
 hash function used by ts_hash_map. Uses dbj2 method More...
 
template<typename KEY , typename VALUE , unsigned int NUM_BYTES_HASH_TABLE = 1, unsigned int NUM_HAS_TABLE_COLLISIONS_ALLOWED = 5, typename VECTOR_T = mrpt::utils::CArray< mrpt::utils::CArray<ts_map_entry<KEY,VALUE>, NUM_HAS_TABLE_COLLISIONS_ALLOWED>, 1u << (8*NUM_BYTES_HASH_TABLE)> > class ts_hash_map { public: typedef ts_hash_map<KEY, VALUE, NUM_BYTES_HASH_TABLE, NUM_HAS_TABLE_COLLISIONS_ALLOWED, VECTOR_T> self_t; typedef KEY key_type; typedef ts_map_entry<KEY,VALUE> value_type; typedef VECTOR_T vec_t; struct iterator; struct const_iterator { public: const_iterator() : m_vec(NULL), m_parent(NULL), m_idx_outer(0), m_idx_inner(0) {} const_iterator(const VECTOR_T &vec, const self_t &parent, int idx_outer, int idx_inner) : m_vec(const_cast<VECTOR_T*>(&vec)), m_parent(const_cast<self_t*>(&parent)), m_idx_outer(idx_outer), m_idx_inner(idx_inner) {} const_iterator & operator = (const const_iterator& o) { m_vec = o.m_vec; m_idx_outer = o.m_idx_outer; m_idx_inner = o.m_idx_inner; return *this; } bool operator == (const const_iterator& o) const { return m_vec == o.m_vec && m_idx_outer == o.m_idx_outer && m_idx_inner == o.m_idx_inner; } bool operator != (const const_iterator& o) const { return !(*this==o); } const value_type & operator *() const { return (*m_vec)[m_idx_outer][m_idx_inner]; } const value_type * operator ->() const { return &(*m_vec)[m_idx_outer][m_idx_inner]; } inline const_iterator operator ++(int) { const_iterator aux = *this; ++(*this); return aux; } inline const_iterator& operator ++() { incr(); return *this; } protected: VECTOR_T *m_vec; self_t *m_parent; int m_idx_outer>
iterator mrpt::utils::operator++ (int)
 A thread-safe (ts) container which minimally emulates a std::map<>'s [] and find() methods but which is implemented as a linear vector indexed by a hash of KEY. More...
 
iteratormrpt::utils::operator++ ()
 
Constructors, read/write access and other operations
 mrpt::utils::ts_hash_map ()
 < Default constructor */ More...
 
void mrpt::utils::clear ()
 Clear the contents of this container. More...
 
bool mrpt::utils::empty () const
 
VALUE & mrpt::utils::operator[] (const KEY &key)
 Write/read via [i] operator, that creates an element if it didn't exist already. More...
 
const_iterator mrpt::utils::find (const KEY &key) const
 
const_iterator mrpt::utils::begin () const
 
const_iterator mrpt::utils::end () const
 

Variables

vec_t mrpt::utils::m_vec
 The actual container. More...
 
size_t mrpt::utils::m_size
 Number of elements accessed with write access so far. More...
 



Page generated by Doxygen 1.8.14 for MRPT 1.5.7 Git: 8277875f6 Mon Jun 11 02:47:32 2018 +0200 at lun oct 28 01:50:49 CET 2019