#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);
	}
};
Соседние файлы в папке testgr