35 #ifndef LVR2_UTIL_CLUSTERBIMAP_H_ 36 #define LVR2_UTIL_CLUSTERBIMAP_H_ 53 template<
typename HandleT>
71 template<
typename HandleT>
127 size_t numCluster()
const;
141 void reserve(
size_t newCap);
144 size_t numHandles()
const;
162 #include "lvr2/util/ClusterBiMap.tcc" A vector which guarantees stable indices and features O(1) deletion.
bool operator!=(const ClusterBiMapIterator &other) const
bool operator==(const ClusterBiMapIterator &other) const
ClusterHandle operator*() const
Iterator over handles in this vector, which skips deleted elements.
Semantically equivalent to boost::optional<ClusterHandle>
A map of clusters, which also saves a back-reference from handle to cluster.
Handle to access Cluster of the ClusterBiMap.
size_t m_numHandles
Number of handels in all clusters.
Represents a group of handles, which are somehow connected.
StableVector< ClusterHandle, Cluster< HandleT > > m_cluster
Clusters.
Iterator over cluster handles in this cluster map.
ClusterBiMapIterator(StableVectorIterator< ClusterHandle, Cluster< HandleT >> iterator)
DenseAttrMap< HandleT, ClusterHandle > m_clusterMap
Map from handle -> cluster to save the back-reference for stored handles.
ClusterBiMapIterator & operator++()
StableVectorIterator< ClusterHandle, Cluster< HandleT > > m_iterator
A map with constant lookup overhead using small-ish integer-keys.