escript  Revision_
DomainException.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_DomainException_20040608_H
19 #define escript_DomainException_20040608_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  DomainException() : Parent() { updateMessage();}
54  DomainException(const char *cstr) : Parent(cstr) { updateMessage();}
60  DomainException(const std::string &str) : Parent(str) { updateMessage();}
66  DomainException(const DomainException &other) : Parent(other)
67  {
68  updateMessage();
69  }
70 
72  inline virtual DomainException &
74  {
75  Parent::operator=(other);
76  updateMessage();
77  return *this;
78  }
79 
88  virtual const std::string & exceptionName() const;
89 
90  private:
91 
92  //
93  // the exception name is immutable and class-wide.
94  // Inheritor note; you need one of these too.
95  // and an overloaded exceptionName() in your .cpp implementation file.
96  static const std::string exceptionNameValue;
97  };
98 
99 } // end of namespace
100 #endif
void updateMessage()
update m_exceptionMessage after a reason update.
Definition: EsysException.h:202
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
DomainException(const std::string &str)
Constructor for the exception.
Definition: DomainException.h:60
DomainException(const char *cstr)
Constructor for the exception.
Definition: DomainException.h:54
EsysException Parent
Definition: DomainException.h:40
DomainException()
Default constructor for the exception.
Definition: DomainException.h:48
virtual DomainException & operator=(const DomainException &other) THROW(NO_ARG)
Definition: DomainException.h:73
DomainException exception class.
Definition: DomainException.h:35
static const std::string exceptionNameValue
Definition: DomainException.h:96
#define THROW(ARG)
Definition: esysUtils/src/system_dep.h:53
EsysException()
Default Constructor. Creates an exception with no message.
Definition: EsysException.cpp:29
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:54
DomainException(const DomainException &other)
Copy Constructor for the exception.
Definition: DomainException.h:66
virtual const std::string & exceptionName() const
Returns the name of the exception.
Definition: DomainException.cpp:27
virtual ~DomainException() THROW(NO_ARG)
Destructor.
Definition: DomainException.h:82