Added missing file

This commit is contained in:
Philippe Tillet
2015-01-27 13:07:26 -05:00
parent 2a249d26c6
commit c13059d69c
2 changed files with 39 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
#ifndef ATIDLAS_EXCEPTION_UNKNOWN_DATATYPE_H
#define ATIDLAS_EXCEPTION_UNKNOWN_DATATYPE_H
#include <string>
#include <exception>
namespace atidlas
{
/** @brief Exception for the case the generator is unable to deal with the operation */
class unknown_datatype : public std::exception
{
public:
unknown_datatype(int);
virtual const char* what() const throw();
virtual ~unknown_datatype() throw();
private:
std::string message_;
};
}
#endif

View File

@@ -0,0 +1,16 @@
#include "atidlas/exception/unknown_datatype.h"
#include "atidlas/tools/to_string.hpp"
namespace atidlas
{
unknown_datatype::unknown_datatype(int v) :
message_("ATIDLAS: The data-type provided was not recognized. The datatype code provided is " + tools::to_string(v)) {}
const char* unknown_datatype::what() const throw()
{ return message_.c_str(); }
unknown_datatype::~unknown_datatype() throw()
{}
}