From c13059d69c72ad8a2b525798fa3c69a457b39c41 Mon Sep 17 00:00:00 2001 From: Philippe Tillet Date: Tue, 27 Jan 2015 13:07:26 -0500 Subject: [PATCH] Added missing file --- include/atidlas/exception/unknown_datatype.h | 23 ++++++++++++++++++++ lib/exception/unknown_datatype.cpp | 16 ++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 include/atidlas/exception/unknown_datatype.h create mode 100644 lib/exception/unknown_datatype.cpp diff --git a/include/atidlas/exception/unknown_datatype.h b/include/atidlas/exception/unknown_datatype.h new file mode 100644 index 000000000..c7fefffbe --- /dev/null +++ b/include/atidlas/exception/unknown_datatype.h @@ -0,0 +1,23 @@ +#ifndef ATIDLAS_EXCEPTION_UNKNOWN_DATATYPE_H +#define ATIDLAS_EXCEPTION_UNKNOWN_DATATYPE_H + +#include +#include + +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 diff --git a/lib/exception/unknown_datatype.cpp b/lib/exception/unknown_datatype.cpp new file mode 100644 index 000000000..d4eb9e1f8 --- /dev/null +++ b/lib/exception/unknown_datatype.cpp @@ -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() +{} + +}