diff --git a/radio/processor/src/Buffer.hpp b/radio/processor/src/Buffer.hpp index 260de62..5e5dabf 100644 --- a/radio/processor/src/Buffer.hpp +++ b/radio/processor/src/Buffer.hpp @@ -16,24 +16,6 @@ namespace Processor { -class Exception : public std::exception -{ - std::string m_msg; - - public: - Exception(std::string msg) - : std::exception() - , m_msg(msg) - { - - } - const char* what() const _GLIBCXX_TXN_SAFE_DYN _GLIBCXX_NOTHROW - { - return m_msg.c_str(); - } - -}; - class IBuffer { public: diff --git a/radio/processor/src/Exception.hpp b/radio/processor/src/Exception.hpp new file mode 100644 index 0000000..ae17db0 --- /dev/null +++ b/radio/processor/src/Exception.hpp @@ -0,0 +1,28 @@ +#ifndef __PROCESSOR_EXCEPTION_HPP__ +#define __PROCESSOR_EXCEPTION_HPP__ + +#include +#include + +#define EXC_MSG(code) (std::string(__PRETTY_FUNCTION__) + ", line " + std::to_string(__LINE__) + ", code " + std::to_string(code)) +#define EXC_EXCEPT(code) throw Exception(EXC_MSG(code)) + +class Exception : public std::exception +{ + std::string m_msg; + + public: + Exception(std::string msg) + : std::exception() + , m_msg(msg) + { + + } + const char* what() const _GLIBCXX_TXN_SAFE_DYN _GLIBCXX_NOTHROW + { + return m_msg.c_str(); + } + +}; + +#endif // __PROCESSOR_EXCEPTION_HPP__