| 231 | int tableSize; |
| 232 | public: |
| 233 | class iterator |
| 234 | { |
| 235 | class MyHashMap &hashMap; |
| 236 | int index; // having index==-1 means that we are before/after the elements. |
| 237 | std::set<ZVector>::iterator i; |
| 238 | public: |
| 239 | bool operator++() |
| 240 | { |
| 241 | if(index==-1)goto search; |
| 242 | i++; |
| 243 | while(i==hashMap.container[index].end()) |
| 244 | { |
| 245 | search: |
| 246 | index++; |
| 247 | if(index>=hashMap.tableSize){ |
| 248 | index=-1; |
| 249 | return false; |
| 250 | } |
| 251 | i=hashMap.container[index].begin(); |
| 252 | } |
| 253 | return true; |
| 254 | } |
| 255 | ZVector const & operator*()const |
| 256 | { |
| 257 | return *i; |
| 258 | } |
| 259 | ZVector operator*() |
| 260 | { |
| 261 | return *i; |
| 262 | } |
| 263 | iterator(MyHashMap &hashMap_): |
| 264 | hashMap(hashMap_) |
| 265 | { |
| 266 | index=-1; |
| 267 | } |
| 268 | }; |
| 269 | unsigned int function(const ZVector &v) |
| 270 | { |
| 271 | unsigned int ret=0; |