#include <iostream>
#include <string>
#include <fstream>
#include <cassert>

#include "./exception/Exception.h"

using namespace std;

#ifndef MODEL_READER_H
#define MODEL_READER_H

///Abstract class for 3d model file reading
template< typename Storage>
class ModelReader
{
protected:
	fstream file;
public:
	ModelReader(const string &fileName);
	~ModelReader();
	virtual bool readNextGroup(Storage& dst_storage)=0;
};

template< typename Storage> ModelReader<Storage>::ModelReader(const string &fileName)
{
	this->file.open(fileName.c_str() );

	if ( this->file.fail() )
	{
		throw FileException( fileName );
	}

}
template< typename Storage> ModelReader<Storage>::~ModelReader()
{
	this->file.close();
}


#endif