ode/src/iterator.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 11 Jun 2010 13:54:51 +0300
changeset 30 56e9a0aaad89
parent 0 2f259fa3e83a
permissions -rw-r--r--
Revision: 201021 Kit: 2010123

#include "set.h"

iterator::iterator(set* sc){
    current = 1;
    this->s = sc;
}

iterator::~iterator(){
     delete s;
}

pair iterator::getElem(){
	return s->getElem(this -> current);
}

int iterator::hasNext(){
	if (current == s->length()) return 0;
	else return 1;
}

void iterator::next(){
	if (this->hasNext()) current++;
}

void iterator::setToFirst(){
	current = 1;
}