00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00018 #ifndef __vtkHashMapIterator_h
00019 #define __vtkHashMapIterator_h
00020
00021 #include "vtkAbstractIterator.h"
00022
00023 template <class DataType> class vtkVectorIterator;
00024 template <class KeyType, class DataType> class vtkHashMap;
00025 template <class KeyType, class DataType> class vtkAbstractMapItem;
00026
00027 template <class KeyType,class DataType>
00028 class vtkHashMapIterator : public vtkAbstractIterator<KeyType,DataType>
00029 {
00030 friend class vtkHashMap<KeyType,DataType>;
00031 virtual const char* GetClassNameInternal() const { return "vtkHashMapIterator"; }
00032
00033 public:
00034
00037 int GetKey(KeyType&);
00038
00041 int GetData(DataType&);
00042
00045 int GetKeyAndData(KeyType&, DataType&);
00046
00049 int SetData(const DataType&);
00050
00053 void InitTraversal();
00054
00057 int IsDoneWithTraversal();
00058
00060 void GoToNextItem();
00061
00063 void GoToPreviousItem();
00064
00066 void GoToFirstItem();
00067
00069 void GoToLastItem();
00070
00071 protected:
00072 static vtkHashMapIterator<KeyType,DataType> *New();
00073
00074 vtkHashMapIterator();
00075 virtual ~vtkHashMapIterator();
00076
00077 void ScanForward();
00078 void ScanBackward();
00079
00080 typedef vtkAbstractMapItem<KeyType,DataType> ItemType;
00081 typedef vtkVectorIterator<ItemType> BucketIterator;
00082
00083 vtkIdType Bucket;
00084 BucketIterator* Iterator;
00085
00086 private:
00087 vtkHashMapIterator(const vtkHashMapIterator<KeyType,DataType>&);
00088 void operator=(const vtkHashMapIterator<KeyType,DataType>&);
00089 };
00090
00091 #ifdef VTK_NO_EXPLICIT_TEMPLATE_INSTANTIATION
00092 #include "vtkHashMapIterator.txx"
00093 #endif
00094
00095 #endif
00096
00097
00098