#pragma once
#include <string>

#define THROW(reason) throw(M3DError(reason, __FILE__, __FUNCTION__, __LINE__))
class M3DError
{
	public:
		M3DError( std::string reason, std::string file, std::string function, int line ) : _file_( file ), _function_( function ), _line_( line ), _reason_( reason ) {}
		~M3DError() {}
		std::string get_file() const { return _file_;}
		std::string get_function() const { return _function_;}
		std::string get_reason() const { return _reason_;}
		int get_line() const { return _line_;}
		const char* what() const { return _reason_.c_str();}
	private:
		std::string _file_;
		std::string _function_;
		int _line_;
		std::string _reason_;
};
