escript  Revision_
SplitWorldException.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2014-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 // Adapted from FunctionSpaceException.h
18 
19 #ifndef __ESCRIPT_SPLITWORLDEXCEPTION_H__
20 #define __ESCRIPT_SPLITWORLDEXCEPTION_H__
21 
22 #include "system_dep.h"
23 #include "esysUtils/EsysException.h"
24 
25 namespace escript
26 {
27 
37  {
38 
39  protected:
40 
42 
43  public:
55  SplitWorldException(const char *cstr) : Parent(cstr) { updateMessage();}
61  SplitWorldException(const std::string &str) :
62  Parent(str) { updateMessage();}
68  SplitWorldException(const SplitWorldException &other) : Parent(other)
69  {
70  updateMessage();
71  }
72 
74  inline SplitWorldException &
76  {
77  Parent::operator=(other);
78  updateMessage();
79  return *this;
80  }
81 
82 
91  virtual const std::string& exceptionName() const;
92 
93  private:
94 
95  //
96  // the exception name is immutable and class-wide.
97  // Inheritor note; you need one of these too.
98  // and an overloaded exceptionName() in your .cpp implementation file.
99  static const std::string exceptionNameValue;
100  };
101 
102 } // end of namespace
103 
104 #endif // __ESCRIPT_SPLITWORLDEXCEPTION_H__
105 
void updateMessage()
update m_exceptionMessage after a reason update.
Definition: EsysException.h:202
virtual const std::string & exceptionName() const
Returns the name of the exception.
Definition: SplitWorldException.cpp:30
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
SplitWorldException exception class.
Definition: SplitWorldException.h:36
EsysException Parent
Definition: SplitWorldException.h:41
static const std::string exceptionNameValue
Definition: SplitWorldException.h:99
SplitWorldException(const char *cstr)
Constructor for the exception.
Definition: SplitWorldException.h:55
SplitWorldException()
Default constructor for the exception.
Definition: SplitWorldException.h:49
SplitWorldException(const SplitWorldException &other)
Copy Constructor for the exception.
Definition: SplitWorldException.h:68
#define THROW(ARG)
Definition: esysUtils/src/system_dep.h:53
EsysException()
Default Constructor. Creates an exception with no message.
Definition: EsysException.cpp:29
virtual ~SplitWorldException() THROW(NO_ARG)
Destructor.
Definition: SplitWorldException.h:85
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:54
SplitWorldException & operator=(const SplitWorldException &other) THROW(NO_ARG)
Definition: SplitWorldException.h:75
SplitWorldException(const std::string &str)
Constructor for the exception.
Definition: SplitWorldException.h:61