escript  Revision_Unversioneddirectory
DataException.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2016 by The University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Apache License, version 2.0
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development 2012-2013 by School of Earth Sciences
13 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16 
17 
18 #if !defined escript_DataException_20040324_H
19 #define escript_DataException_20040324_H
20 #include "system_dep.h"
21 
22 #include "esysUtils/EsysException.h"
23 
24 namespace escript
25 {
26 
36  {
37 
38  protected:
39 
41 
42  public:
48  DataException() : Parent() { updateMessage();}
54  DataException(const char *cstr) : Parent(cstr) { updateMessage();}
60  DataException(const std::string &str) : Parent(str) { updateMessage();}
66  DataException(const DataException &other) : Parent(other)
67  {
68  updateMessage();
69  }
70 
72  inline DataException &
74  {
75  Parent::operator=(other);
76  updateMessage();
77  return *this;
78  }
79 
80 
83  virtual ~DataException() THROW(NO_ARG) {}
84 
90  virtual const std::string & exceptionName() const;
91 
92  private:
93 
94  //
95  // the exception name is immutable and class-wide.
96  // Inheritor note; you need one of these too.
97  // and an overloaded exceptionName() in your .cpp implementation file.
98  static const std::string exceptionNameValue;
99 
100 
101  };
102 
103 } // end of namespace
104 
105 
106 #endif
void updateMessage()
update m_exceptionMessage after a reason update.
Definition: EsysException.h:202
DataException()
Default constructor for the exception.
Definition: DataException.h:48
A base class for exception classes used within Esys system.
Definition: EsysException.h:31
Definition: AbstractContinuousDomain.cpp:24
#define NO_ARG
Definition: esysUtils/src/system_dep.h:56
DataException(const DataException &other)
Copy Constructor for the exception.
Definition: DataException.h:66
DataException(const std::string &str)
Constructor for the exception.
Definition: DataException.h:60
#define THROW(ARG)
Definition: esysUtils/src/system_dep.h:53
DataException(const char *cstr)
Constructor for the exception.
Definition: DataException.h:54
EsysException()
Default Constructor. Creates an exception with no message.
Definition: EsysException.cpp:29
virtual const std::string & exceptionName() const
Returns the name of the exception.
Definition: DataException.cpp:26
DataException exception class.
Definition: DataException.h:35
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:54
EsysException Parent
Definition: DataException.h:40
static const std::string exceptionNameValue
Definition: DataException.h:98
virtual ~DataException() THROW(NO_ARG)
Destructor.
Definition: DataException.h:83
DataException & operator=(const DataException &other) THROW(NO_ARG)
Definition: DataException.h:73