34 #ifndef LVR2_ATTRMAPS_LISTMAP_H_ 35 #define LVR2_ATTRMAPS_LISTMAP_H_ 64 template<
typename HandleT,
typename ValueT>
87 ListMap(
const ValueT& defaultValue);
95 ListMap(
size_t countElements,
const ValueT& defaultValue);
101 boost::optional<ValueT>
insert(HandleT key,
const ValueT& value)
final;
102 boost::optional<ValueT>
erase(HandleT key)
final;
104 boost::optional<ValueT&>
get(HandleT key)
final;
105 boost::optional<const ValueT&>
get(HandleT key)
const final;
121 typename vector<pair<HandleT, ValueT>>::const_iterator
keyIterator(HandleT key)
const;
122 typename vector<pair<HandleT, ValueT>>::iterator
keyIterator(HandleT key);
124 template<
typename,
typename>
friend class ListMap;
127 template<
typename HandleT,
typename ValueT>
131 ListMapIterator(
typename vector<pair<HandleT, ValueT>>::const_iterator iter);
137 std::unique_ptr<AttributeMapHandleIterator<HandleT>> clone()
const final;
140 typename vector<pair<HandleT, ValueT>>::const_iterator
m_iter;
145 #include "lvr2/attrmaps/ListMap.tcc" boost::optional< ValueT > insert(HandleT key, const ValueT &value) final
Inserts the given value at the given key position.
void reserve(size_t newCap)
Allocates space for at least newCap more elements.
A simple implementation of AttributeMap for a small number of values.
Simple convinience wrapper for unique_ptr<AttributeMapHandleIterator>
Iterator over keys of an attribute map.
void clear() final
Removes all values from the map.
vector< pair< HandleT, ValueT > >::const_iterator keyIterator(HandleT key) const
vector< pair< HandleT, ValueT > > m_list
Interface for attribute maps.
AttributeMapHandleIteratorPtr< HandleT > end() const final
Returns an iterator to the end of all keys.
size_t numValues() const final
Returns the number of values in this map.
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.
vector< pair< HandleT, ValueT > >::const_iterator m_iter
boost::optional< ValueT > m_default
AttributeMapHandleIteratorPtr< HandleT > begin() const final
Returns an iterator over all keys of this map. The order of iteration is unspecified.
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...
ListMap()
Creates an empty map without default element set.