Go to the documentation of this file.
34 #ifndef LVR2_ATTRMAPS_HASHMAP_H_
35 #define LVR2_ATTRMAPS_HASHMAP_H_
37 #include <unordered_map>
41 using std::unordered_map;
46 template<
typename HandleT,
typename ValueT>
69 HashMap(
const ValueT& defaultValue);
77 HashMap(
size_t countElements,
const ValueT& defaultValue);
83 boost::optional<ValueT>
insert(HandleT key,
const ValueT& value)
final;
84 boost::optional<ValueT>
erase(HandleT key)
final;
86 boost::optional<ValueT&>
get(HandleT key) final;
87 boost::optional<const ValueT&>
get(HandleT key) const final;
99 unordered_map<HandleT, ValueT>
m_map;
103 template<typename HandleT, typename ValueT>
107 HashMapIterator(
typename unordered_map<HandleT, ValueT>::const_iterator iter);
113 std::unique_ptr<AttributeMapHandleIterator<HandleT>> clone()
const final;
116 typename unordered_map<HandleT, ValueT>::const_iterator
m_iter;
121 #include "lvr2/attrmaps/HashMap.tcc"
void reserve(size_t newCap)
Allocates space for at least newCap more elements.
boost::optional< ValueT > m_default
boost::optional< ValueT & > get(HandleT key) final
Returns the value associated with the given key or None if there is no associated value.
Interface for attribute maps.
bool containsKey(HandleT key) const final
Returns true iff the map contains a value associated with the given key.
boost::optional< ValueT > erase(HandleT key) final
Removes the value associated with the given key.
void clear() final
Removes all values from the map.
Iterator over keys of an attribute map.
AttributeMapHandleIteratorPtr< HandleT > begin() const final
Returns an iterator over all keys of this map. The order of iteration is unspecified.
AttributeMapHandleIteratorPtr< HandleT > end() const final
Returns an iterator to the end of all keys.
HashMap()
Creates an empty map without default element set.
boost::optional< ValueT > insert(HandleT key, const ValueT &value) final
Inserts the given value at the given key position.
unordered_map< HandleT, ValueT >::const_iterator m_iter
size_t numValues() const final
Returns the number of values in this map.
Simple convinience wrapper for unique_ptr<AttributeMapHandleIterator>
BaseVector< CoordType > operator*(const Eigen::Matrix< Scalar, 4, 4 > &mat, const BaseVector< CoordType > &normal)
Multiplication operator to support transformation with Eigen matrices. Rotates the normal,...
unordered_map< HandleT, ValueT > m_map
lvr2
Author(s): Thomas Wiemann
, Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Wed Mar 2 2022 00:37:23