Sleeping Wombat Common Library  0.50.0
swCommonLibrary
Exception.h
1 #pragma once
2 
3 
5 
6 #include <exception>
7 #include <string>
8 
9 
10 
11 namespace sw
12 {
13 
14 
17 class Exception : public std::exception
18 {
19 private:
20 protected:
21 public:
22  explicit Exception () = default;
23  virtual ~Exception () = default;
24 
26  virtual std::string ErrorMessage () const = 0;
27 };
28 
29 DEFINE_PTR_TYPE( Exception )
30 
31 
32 
35 {
36 private:
37 protected:
38 
39  std::string m_errorMessage;
40 
41 public:
42 
43  // ================================ //
44  //
45  explicit RuntimeException ( const std::string& message )
46  : m_errorMessage( message )
47  {}
48 
49  virtual ~RuntimeException () = default;
50 
51 
52  virtual std::string ErrorMessage () const { return m_errorMessage; }
53 };
54 
55 DEFINE_PTR_TYPE( RuntimeException )
56 
57 
58 } // sw
59 
Base exception class.
Definition: Exception.h:17
Definition: Exception.h:11
virtual std::string ErrorMessage() const =0
Returns human readable exception message.
virtual std::string ErrorMessage() const
Returns human readable exception message.
Definition: Exception.h:52
Plik zawiera definicje podstawowych typów zmiennych.
Base Sleeping Wombat exception class containing string error message.
Definition: Exception.h:34