SOFA API  014b24ea
Open source framework for multi-physics simuation
sofa::helper::ptr_stable_id< T > Class Template Reference

#include <map_ptr_stable_compare.h>

Detailed Description

template<typename T>
class sofa::helper::ptr_stable_id< T >

An object transforming pointers to stable ids, i.e. whose value depend on the order the pointers are processed, and not their (potentially random) value

Protected Attributes

std::shared_ptr< unsigned intcounter
 
std::shared_ptr< std::map< T *, unsigned int > > idMap
 

Public Member Functions

 ptr_stable_id ()
 
unsigned int operator() (T *p)
 
unsigned int id (T *p)
 

Attribute details

template<typename T >
std::shared_ptr<unsigned int> sofa::helper::ptr_stable_id< T >::counter
mutableprotected
template<typename T >
std::shared_ptr< std::map<T*,unsigned int> > sofa::helper::ptr_stable_id< T >::idMap
mutableprotected

Constructor details

template<typename T >
sofa::helper::ptr_stable_id< T >::ptr_stable_id ( )
inline

Function details

template<typename T >
unsigned int sofa::helper::ptr_stable_id< T >::id ( T *  p)
inline
template<typename T >
unsigned int sofa::helper::ptr_stable_id< T >::operator() ( T *  p)
inline