// Iterates through all the elements in a Cache.  Modifying the Cache
// can do wierd things to the iterators.

#include "cache.h"
#include "cacheEntry.h"

class CacheIterator
{
private:
  Cache* cache;
  
  // The current cache entry.
  CacheEntry* entry;

  // The previous cache entry.  I don't use this, but I keep it around
  // in case I decide to implement delete.
  CacheEntry* prev;

  // The hash table slot containing entry.
  long slot;


public:
  // cache is the Cache to iterate.
  CacheIterator(Cache* initCache);
  
  // Returns the current cache entry for this iterator.
  CacheEntry* getCurrent();
  
  // Returns 0 if there are no more, 1 if there is.
  int moveNext();
};
