#ifndef _DATABASE_HPP_
#define _DATABASE_HPP_

#include <vector>
#include <string>
#include <stdexcept>

namespace database {


class DataBase
{
	private:
		std::vector<const double *> observations;
		std::string format;
		unsigned dimension;

	public:
		DataBase()
		:dimension(0)
		{}

		DataBase( std::string fileName)
		{
			loadData(fileName);
		}

		bool loadData( std::string fileName);
		void setFormat( std::string _format )
		{
			_format=format;
		}

		std::string getFormat() const
		{
			return format;
		}

		const double * getObservation( unsigned id ) const
		{
		 	if( id < observations.size() )
				return observations[id];
			else
			{
				throw std::out_of_range("index out of capacity");
				return new double;
			}
		}
		unsigned getDimension() const
		{
			return dimension;
		}
		
		unsigned getSize() const
		{
			return observations.size();
		}
		
		~DataBase()
		{
			for(unsigned i=0; i < getSize(); ++i)
			{
				delete observations[i];
			}
		}
};


}

#endif

