ESScript  Revision_4488
EsysAssertException.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2013 by University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Open Software License version 3.0
9 * http://www.opensource.org/licenses/osl-3.0.php
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development since 2012 by School of Earth Sciences
13 *
14 *****************************************************************************/
15 
16 
17 #if !defined escript_EsysAssertException_20040330_H
18 #define escript_EsysAssertException_20040330_H
19 #include "system_dep.h"
20 
21 #include "EsysException.h"
22 
23 
24 namespace esysUtils {
25 
35  {
36 
37  protected:
38 
40 
41  public:
47  inline
54  inline
55  EsysAssertException(const char *cstr) : Parent(cstr) { updateMessage();}
61  inline
62  EsysAssertException(const std::string &str) :
63  Parent(str) { updateMessage();}
69  inline
71  {
72  updateMessage();
73  }
74 
76  inline
79  {
80  Parent::operator=(other);
81  updateMessage();
82  return *this;
83  }
84 
85 
89 
95  virtual const std::string & exceptionName() const;
96 
102  static void assertFailure (const std::string& assertion,
103  const std::string& date,
104  const std::string& file,
105  int line, const std::string& errDesc);
106  private:
107 
108  //
109  // the exception name is immutable and class-wide.
110  // Inheritor note; you need one of these too.
111  // and an overloaded exceptionName() in your .cpp implementation file.
112  static const std::string exceptionNameValue;
113  };
114 
115 } // end of namespace
116 
117 #endif