blitzdg
an open-source project aiming to implement parallel discontinuous Galerkin (dg) solvers for common partial differential equations systems using blitz++ for array and tensor manipulations and MPI for distributed parallelism.
assertionexception.h
1 
2 // Copyright Joakim Karlsson & Kim Gräsman 2010-2013.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
6 
7 #ifndef IGLOO_ASSERTIONEXCEPTION_H
8 #define IGLOO_ASSERTIONEXCEPTION_H
9 
10 namespace snowhouse {
11  class AssertionException : public std::exception
12  {
13  public:
14  AssertionException(const std::string& message)
15  : m_message(message), m_fileName(""), m_line(0)
16  {}
17 
18  AssertionException(const std::string& message, const std::string& fileName, unsigned int line)
19  : m_message(message), m_fileName(fileName), m_line(line)
20  {}
21 
22  virtual ~AssertionException() throw()
23  {
24  }
25 
26  std::string GetMessage() const
27  {
28  return m_message;
29  }
30 
31  std::string GetFilename() const
32  {
33  return m_fileName;
34  }
35 
36  unsigned int GetLineNumber() const
37  {
38  return m_line;
39  }
40 
41  private:
42  std::string m_message;
43  std::string m_fileName;
44  unsigned int m_line;
45  };
46 }
47 
48 #endif // IGLOO_ASSERTIONEXCEPTION_H
Definition: assert.h:13
Definition: assertionexception.h:11