Guest User

Untitled

a guest
Jun 21st, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. #define SOLATIS_EXCEPTION_DECL(name) \
  2. class name : public std::exception { \
  3. public : \
  4. name () : std::exception () {}; \
  5. name ( const name &that ) : std::exception () { \
  6. _what += that._what; \
  7. } \
  8. virtual ~name() throw(){}; \
  9. virtual const char *what() const throw() { \
  10. return _what.c_str(); \
  11. } \
  12. template<typename T> name & operator<<( const T& t ) { \
  13. _stream << t; \
  14. _what = _stream.str (); \
  15. return *this; \
  16. } \
  17. private: \
  18. mutable std::stringstream _stream; \
  19. std::string _what; \
  20. };
  21.  
  22.  
  23. SOLATIS_EXCEPTION_DECL(parse_exception);
  24. SOLATIS_EXCEPTION_DECL(integrity_exception);
  25. SOLATIS_EXCEPTION_DECL(fatal_exception);
Add Comment
Please, Sign In to add comment