[vtk-developers] hast table in VTK

Brad King brad.king at kitware.com
Thu Dec 9 11:31:16 EST 2004


Moreland, Kenneth wrote:
> My thought was that the hash table would just be a collection of
> vtkObjectBase.  In this sense it would be just keys, no values (i.e. a
> set, not a map).
> 
> My intension was an interface sort-of like that for Java's hashtable.
> When a key is inserted, the hashcode is retrieved directly from a method
> on that key.  This would only be possible if vtkObjectBase implemented
> virtual hashcode methods.

If all you want to do is store objects in a hash table for fast lookup, 
just use the pointer value as the hash key.  You can just copy the 
pointer value to an integer and then send it through a hash function.

-Brad



More information about the vtk-developers mailing list