Back to index

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

List of all members.

Public Member Functions

 hashset_iterator_rep (hashset< T > h)
bool busy ()
T next ()
virtual int remains ()

Public Attributes

int ref_count

Private Member Functions

void spool ()

Private Attributes

hashset< Th
int i
list< Tl

Detailed Description

template<class T>
class hashset_iterator_rep< T >

Definition at line 47 of file iterator.cpp.


Constructor & Destructor Documentation

template<class T >
hashset_iterator_rep< T >::hashset_iterator_rep ( hashset< T h)

Definition at line 60 of file iterator.cpp.

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

Member Function Documentation

template<class T >
bool hashset_iterator_rep< T >::busy ( ) [virtual]

Implements iterator_rep< T >.

Definition at line 73 of file iterator.cpp.

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

Implements iterator_rep< T >.

Definition at line 79 of file iterator.cpp.

                               {
  ASSERT (busy (), "end of iterator");
  T x (l->item);
  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 >
void hashset_iterator_rep< T >::spool ( ) [private]

Definition at line 64 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>
hashset<T> hashset_iterator_rep< T >::h [private]

Definition at line 48 of file iterator.cpp.

template<class T>
int hashset_iterator_rep< T >::i [private]

Definition at line 49 of file iterator.cpp.

template<class T>
list<T> hashset_iterator_rep< T >::l [private]

Definition at line 50 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: