Public Member Functions | Friends

nanojit::HashMap< K, T, H >::Iter Class Reference

Iter is an iterator for HashMap, intended to be instantiated on the stack. More...

#include <Containers.h>

Collaboration diagram for nanojit::HashMap< K, T, H >::Iter:

List of all members.

Public Member Functions

 Iter (HashMap< K, T, H > &map)
bool next ()
 return true if more (k,v) remain to be visited
const K & key () const
 return the current key
const T & value () const
 return the current value

Friends

class HashMap

Detailed Description

template<class K, class T, class H = DefaultHash<K>>
class nanojit::HashMap< K, T, H >::Iter

Iter is an iterator for HashMap, intended to be instantiated on the stack.

Iteration order is undefined. Mutating the hashmap while iteration is in progress gives undefined results. All iteration state is in class Iter, so multiple iterations can be in progress at the same time. for example:

HashMap<K,T>::Iter iter(map); while (iter.next()) { K *k = iter.key(); T *t = iter.value(); }


Constructor & Destructor Documentation

template<class K, class T, class H = DefaultHash<K>>
nanojit::HashMap< K, T, H >::Iter::Iter ( HashMap< K, T, H > &  map  )  [inline]

Member Function Documentation

template<class K, class T, class H = DefaultHash<K>>
const K& nanojit::HashMap< K, T, H >::Iter::key (  )  const [inline]

return the current key

template<class K, class T, class H = DefaultHash<K>>
bool nanojit::HashMap< K, T, H >::Iter::next (  )  [inline]

return true if more (k,v) remain to be visited

template<class K, class T, class H = DefaultHash<K>>
const T& nanojit::HashMap< K, T, H >::Iter::value (  )  const [inline]

return the current value


Friends And Related Function Documentation

template<class K, class T, class H = DefaultHash<K>>
friend class HashMap [friend]

The documentation for this class was generated from the following file: