The Dirtchamber
A mixed reality testing environment for real-time global illumination algorithms
exception.h
Go to the documentation of this file.
1 /*
2 * Dune D3D library - Tobias Alexander Franke 2011
3 * For copyright and license see LICENSE
4 * http://www.tobias-franke.eu
5 */
6 
9 #ifndef DUNE_EXCEPTION
10 #define DUNE_EXCEPTION
11 
12 #include <stdexcept>
13 
14 #include "unicode.h"
15 
16 namespace dune
17 {
25  class exception : public std::exception
26  {
27  protected:
28  tstring msg_;
29 
30  public:
31  exception(tstring msg)
32  {
33  msg_ = msg;
34  }
35 
36  virtual const char* what() const
37  {
38  return to_string(msg_).c_str();
39  }
40 
42  virtual const tstring& msg() const
43  {
44  return msg_;
45  }
46 
47  virtual ~exception() throw()
48  {
49  }
50  };
51 }
52 
53 #endif
Exception class.
Definition: exception.h:25
virtual const tstring & msg() const
Return exception message as tstring.
Definition: exception.h:42