
//File SetIterator.h - contains definition of SetIterator class

#ifndef _setiterator_h
#define _setiterator_h

#include "Set.h"

template <class T>
class SetIterator{			//Entire class provided in skeleton code

public:
	SetIterator(Set<T> & c, int position = 0)
		:col(c) {
		index = position;
	}
	SetIterator()
		:col(null), index(0) {
	}
	~SetIterator(){
		//No objects created on heap
	}
	SetIterator<T> & operator++() {
		index++;
		return *this;
	}
	T & operator*() {
		return *(col.elements[index]);
	}
	T * operator->() {
		return col.elements[index];
	}
	bool operator==(const SetIterator<T> & iter) {
		return (&col == &(iter.col)) && (index == iter.index);
	}
	bool operator!=(const SetIterator<T> & iter) {
		return !operator==(iter);
	}

private:
     Set<T> & col;
     int index;

};

#endif