8 #define MARLINMT_THROW( message ) throw marlinmt::Exception( __LINE__, __PRETTY_FUNCTION__, __FILE__, message ) 9 #define MARLINMT_THROW_T( ExceptionType, message ) throw ExceptionType( __LINE__, __PRETTY_FUNCTION__, __FILE__, message ) 10 #define MARLINMT_RETHROW( orig, message ) throw marlinmt::Exception( orig, __LINE__, __PRETTY_FUNCTION__, __FILE__, message ) 11 #define MARLINMT_RETHROW_T( ExceptionType, orig, message ) throw ExceptionType( orig, __LINE__, __PRETTY_FUNCTION__, __FILE__, message ) 14 #define MARLINMT_SKIP_EVENT( proc ) MARLINMT_THROW_T( marlinmt::SkipEventException, proc->name() ) 15 #define MARLINMT_STOP_PROCESSING( proc ) MARLINMT_THROW_T( marlinmt::StopProcessingException, proc->name() ) 18 #define MARLINMT_DEFINE_EXCEPTION( ClassName ) \ 19 class ClassName : public marlinmt::Exception { \ 21 ClassName() = delete ; \ 22 ClassName( const ClassName & ) = default ; \ 23 ~ClassName() = default ; \ 24 inline ClassName( const std::string &message ) : \ 25 marlinmt::Exception( std::string( #ClassName ) + " - " + message ) {} \ 26 inline ClassName( unsigned int line, const std::string &func, const std::string &fname, const std::string &message ) : \ 27 marlinmt::Exception( line, func, fname, std::string( #ClassName ) + " - " + message ) {} \ 28 template <typename T> \ 29 inline ClassName( const T &rhs, unsigned int line, const std::string &func, const std::string &fname, const std::string &message ) : \ 30 marlinmt::Exception( rhs, line, func, fname, std::string( #ClassName ) + " - " + message ) {} \ 81 Exception(
unsigned int line,
const std::string &func,
const std::string &fname,
const std::string &message ) ;
93 Exception(
const T &rhs,
unsigned int line,
const std::string &func,
const std::string &fname,
const std::string &message ) ;
98 const char*
what()
const noexcept override ;
109 std::string
createMessage(
unsigned int line,
const std::string &func,
const std::string &fname,
const std::string &message )
const ;
120 std::string
createMessage(
const std::string &previous,
unsigned int line,
const std::string &func,
const std::string &fname,
const std::string &message )
const ;
130 template <
typename T>
131 inline Exception::Exception(
const T &rhs,
unsigned int line,
const std::string &func,
const std::string &fname,
const std::string &message ) :
const char * what() const noexcept override
Get the full exception message.
std::string createMessage(unsigned int line, const std::string &func, const std::string &fname, const std::string &message) const
Helper function creating the full exception message.
MARLINMT_DEFINE_EXCEPTION(SkipEventException)
Definition of Marlin exceptions.
const std::string _message
< The full exception message
virtual ~Exception()=default