Back to index

texmacs  1.0.7.15
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
hashmap_iterator_rep< T, U > Class Template Reference
Inheritance diagram for hashmap_iterator_rep< T, U >:
Inheritance graph
[legend]
Collaboration diagram for hashmap_iterator_rep< T, U >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 hashmap_iterator_rep (hashmap< T, U > h)
bool busy ()
T next ()
virtual int remains ()

Public Attributes

int ref_count

Private Member Functions

void spool ()

Private Attributes

hashmap< T, U > h
int i
list< hashentry< T, U > > l

Detailed Description

template<class T, class U>
class hashmap_iterator_rep< T, U >

Definition at line 94 of file iterator.cpp.


Constructor & Destructor Documentation

template<class T , class U >
hashmap_iterator_rep< T, U >::hashmap_iterator_rep ( hashmap< T, U >  h)

Definition at line 107 of file iterator.cpp.

                                                               :
  h (h2), i (0), l (h2->a[0]) {}

Member Function Documentation

template<class T , class U >
bool hashmap_iterator_rep< T, U >::busy ( ) [virtual]

Implements iterator_rep< T >.

Definition at line 120 of file iterator.cpp.

                                 {
  spool ();
  return i < h->n;
}
template<class T , class U >
T hashmap_iterator_rep< T, U >::next ( ) [virtual]

Implements iterator_rep< T >.

Definition at line 126 of file iterator.cpp.

                                 {
  ASSERT (busy (), "end of iterator");
  T x (l->item.key);
  l= l->next;
  return x;
}
template<class T >
int iterator_rep< T >::remains ( ) [virtual, inherited]

Definition at line 19 of file iterator.cpp.

                          {
  if (busy ()) return -1;
  else return 0;
}
template<class T , class U >
void hashmap_iterator_rep< T, U >::spool ( ) [private]

Definition at line 111 of file iterator.cpp.

                                  {
  if (i >= h->n) return;
  while (is_nil (l)) {
    if ((++i) >= h->n) return;
    l= h->a[i];
  }
}

Here is the call graph for this function:


Member Data Documentation

template<class T , class U >
hashmap<T,U> hashmap_iterator_rep< T, U >::h [private]

Definition at line 95 of file iterator.cpp.

template<class T , class U >
int hashmap_iterator_rep< T, U >::i [private]

Definition at line 96 of file iterator.cpp.

template<class T , class U >
list<hashentry<T,U> > hashmap_iterator_rep< T, U >::l [private]

Definition at line 97 of file iterator.cpp.

int abstract_struct::ref_count [inherited]

Definition at line 142 of file basic.hpp.


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