16 #ifndef SURGSIM_PHYSICS_MLCPMAPPING_H 17 #define SURGSIM_PHYSICS_MLCPMAPPING_H 19 #include <unordered_map> 41 typename std::unordered_map<const T*, ptrdiff_t>::iterator found =
m_indexMapping.find(key);
48 (*found).second = value;
55 typename std::unordered_map<const T*, ptrdiff_t>::const_iterator returnValue =
m_indexMapping.find(key);
56 return (returnValue ==
m_indexMapping.end() ? -1 : (*returnValue).second);
68 #endif // SURGSIM_PHYSICS_MLCPMAPPING_H Definition: CompoundShapeToGraphics.cpp:29
void clear()
Clear the mapping.
Definition: MlcpMapping.h:33
std::unordered_map< const T *, ptrdiff_t > m_indexMapping
The index mapping data structure.
Definition: MlcpMapping.h:62
void setValue(const T *key, size_t value)
Sets the key/value (add an entry if the key is not found, change the value otherwise) ...
Definition: MlcpMapping.h:39
Definition: MlcpMapping.h:27
MlcpMapping()
Definition: MlcpMapping.h:30
ptrdiff_t getValue(const T *key) const
Gets the value from a given key.
Definition: MlcpMapping.h:53