You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
720 B

  1. #ifndef STORM_EXCEPTIONS_EXCEPTIONMACROS_H_
  2. #define STORM_EXCEPTIONS_EXCEPTIONMACROS_H_
  3. /*!
  4. * Macro to generate descendant exception classes. As all classes are nearly the same, this makes changing common
  5. * features much easier.
  6. */
  7. #define STORM_NEW_EXCEPTION(exception_name) class exception_name : public BaseException { \
  8. public: \
  9. exception_name() : BaseException() { \
  10. } \
  11. exception_name(char const* cstr) : BaseException(cstr) { \
  12. } \
  13. exception_name(exception_name const& cp) : BaseException(cp) { \
  14. } \
  15. ~exception_name() throw() { \
  16. } \
  17. template<typename T> \
  18. exception_name& operator<<(T const& var) { \
  19. this->stream << var; \
  20. return *this; \
  21. } \
  22. };
  23. #endif /* STORM_EXCEPTIONS_EXCEPTIONMACROS_H_ */