#include <vtkHashMap.h>
Inheritance diagram for vtkHashMap< KeyType, DataType >:
Public Types | |
typedef vtkAbstractMap< KeyType, DataType > | Superclass |
typedef vtkHashMapIterator< KeyType, DataType > | IteratorType |
Public Member Functions | |
void | PrintSelf (ostream &os, vtkIndent indent) |
vtkHashMapIterator< KeyType, DataType > * | NewIterator () |
int | SetItem (const KeyType &key, const DataType &data) |
int | RemoveItem (const KeyType &key) |
void | RemoveAllItems () |
int | GetItem (const KeyType &key, DataType &data) |
vtkIdType | GetNumberOfItems () const |
void | SetMaximumLoadFactor (float factor) |
float | GetMaximumLoadFactor () const |
void | SetNumberOfBuckets (vtkIdType n) |
vtkIdType | GetNumberOfBuckets () const |
Static Public Member Functions | |
vtkHashMap< KeyType, DataType > * | New () |
Protected Types | |
typedef vtkAbstractMapItem< KeyType, DataType > | ItemType |
typedef vtkVector< ItemType > | BucketType |
Protected Member Functions | |
vtkHashMap () | |
virtual | ~vtkHashMap () |
void | CheckLoadFactor () |
void | RehashItems (vtkIdType newNumberOfBuckets) |
vtkIdType | HashKey (const KeyType &key, vtkIdType nbuckets) |
Protected Attributes | |
float | MaximumLoadFactor |
vtkIdType | NumberOfItems |
vtkIdType | NumberOfBuckets |
BucketType ** | Buckets |
Friends | |
class | vtkHashMapIterator< KeyType, DataType > |
vtkHashMap is a an array implementation of the map data structure
Map data structure is a one dimensional sequence of pairs of key and data. On the higher level, it implements mapping from key values to data elements. It can be implemented using array of pairs, hash table, or different trees.
Definition at line 37 of file vtkHashMap.h.
|
Reimplemented from vtkAbstractMap< KeyType, DataType >. Definition at line 42 of file vtkHashMap.h. |
|
Definition at line 43 of file vtkHashMap.h. |
|
Definition at line 96 of file vtkHashMap.h. |
|
Definition at line 97 of file vtkHashMap.h. |
|
|
|
|
|
|
|
|
|
Return an iterator to the list. This iterator is allocated using New, so the developer is responsible for deleating it. |
|
Sets the item with the given key to the given data. It overwrites the old value if it exists, or inserts a new value otherwise. It returns VTK_OK if successfull. |
|
Removes the item with the given key from the map. It returns VTK_OK if successfull. |
|
Remove all items from the map. |
|
Get the data asociated with the given key. It returns VTK_OK if successfull. |
|
Return the number of items currently held in this container. |
|
Set/Get the maximum allowed load factor. If the ratio of number of items to number of buckets exceeds this value, the number of buckets will be increased. A value of zero indicates that no re-hashing is to occur. |
|
Set/Get the maximum allowed load factor. If the ratio of number of items to number of buckets exceeds this value, the number of buckets will be increased. A value of zero indicates that no re-hashing is to occur. |
|
Set/Get the number of buckets currently used in the hash table. Setting the number of buckets will automatically set the MaximumLoadFactor to 0 to prevent resizing. |
|
Set/Get the number of buckets currently used in the hash table. Setting the number of buckets will automatically set the MaximumLoadFactor to 0 to prevent resizing. |
|
|
|
|
|
Hash a key to give an index in the range [0,nbuckets-1]. |
|
Definition at line 39 of file vtkHashMap.h. |
|
Definition at line 110 of file vtkHashMap.h. |
|
Definition at line 111 of file vtkHashMap.h. |
|
Definition at line 112 of file vtkHashMap.h. |
|
Definition at line 113 of file vtkHashMap.h. |