blob: d0747742ea6a4d0e0d58eafd1986f41f3fc25018 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef IGLOO_ASSERTIONEXCEPTION_H
#define IGLOO_ASSERTIONEXCEPTION_H
namespace snowhouse {
class AssertionException : public std::exception
{
public:
AssertionException(const std::string& message)
: m_message(message), m_fileName(""), m_line(0)
{}
AssertionException(const std::string& message, const std::string& fileName, unsigned int line)
: m_message(message), m_fileName(fileName), m_line(line)
{}
#if __cplusplus > 199711L
AssertionException(const AssertionException&) = default;
#endif
#if __cplusplus > 199711L
virtual ~AssertionException() noexcept
{
}
#else
virtual ~AssertionException() throw()
{
}
#endif
std::string GetMessage() const
{
return m_message;
}
std::string GetFilename() const
{
return m_fileName;
}
unsigned int GetLineNumber() const
{
return m_line;
}
private:
std::string m_message;
std::string m_fileName;
unsigned int m_line;
};
}
#endif // IGLOO_ASSERTIONEXCEPTION_H
|