Скачиваний:
19
Добавлен:
01.05.2014
Размер:
148.99 Кб
Скачать

Файл iterator.H

#pragma once

#include "CGraph.h"

template <class T>

class GrIterator

{

int index;

CGraph<T>& gr;

public:

GrIterator(CGraph<T>& _gr):gr(_gr)

{

index=0;

}

void goNext()

{index++;}

void goPred()

{index--;}

bool isEnd()

{if (index==(gr.getCount()))

{return true;}

else

{return false;}

}

bool isBegin()

{if (index==0) {return true;}

else

{return false;}

}

T currentElement()

{

return gr.getElementByNom(index);

}

};

Соседние файлы в папке Лабораторная работа 13