escript  Revision_Unversioneddirectory
DudleyAdapterException.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 dudley_DudleyAdapterException_20040526_H
19 #define dudley_DudleyAdapterException_20040526_H
20 #include "system_dep.h"
21 
22 #include "esysUtils/EsysException.h"
23 
24 namespace dudley
25 {
26 
36  {
37 
38  protected:
39 
41 
42  public:
54  DudleyAdapterException(const char *cstr) : Parent(cstr) { updateMessage();}
60  DudleyAdapterException(const std::string &str) :
61  Parent(str) { updateMessage();}
67  DudleyAdapterException(const DudleyAdapterException &other) : Parent(other)
68  {
69  updateMessage();
70  }
71 
75 
81  inline DudleyAdapterException &
83  {
84  Parent::operator=(other);
85  updateMessage();
86  return *this;
87  }
88 
94  virtual const std::string & exceptionName() const;
95 
96  private:
97 
98  //
99  // the exception name is immutable and class-wide.
100  // Inheritor note; you need one of these too.
101  // and an overloaded exceptionName() in your .cpp implementation file.
102  static const std::string exceptionNameValue;
103  };
104 
105 } // end of namespace
106 #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
DudleyAdapterException(const char *cstr)
Constructor for the exception.
Definition: DudleyAdapterException.h:54
#define NO_ARG
Definition: esysUtils/src/system_dep.h:56
DudleyAdapterException(const DudleyAdapterException &other)
Copy Constructor for the exception.
Definition: DudleyAdapterException.h:67
DudleyAdapterException(const std::string &str)
Constructor for the exception.
Definition: DudleyAdapterException.h:60
EsysException Parent
Definition: DudleyAdapterException.h:40
static const std::string exceptionNameValue
Definition: DudleyAdapterException.h:102
#define DUDLEY_DLL_API
Definition: dudley/src/CPPAdapter/system_dep.h:29
virtual const std::string & exceptionName() const
Returns the name of the exception.
Definition: DudleyAdapterException.cpp:29
DudleyAdapterException exception class.
Definition: DudleyAdapterException.h:35
DudleyAdapterException()
Default constructor for the exception.
Definition: DudleyAdapterException.h:48
Definition: DudleyAdapterException.h:24
DudleyAdapterException & operator=(const DudleyAdapterException &other) THROW(NO_ARG)
Assignment operator.
Definition: DudleyAdapterException.h:82
#define THROW(ARG)
Definition: esysUtils/src/system_dep.h:53
EsysException()
Default Constructor. Creates an exception with no message.
Definition: EsysException.cpp:29
virtual ~DudleyAdapterException() THROW(NO_ARG)
Destructor.
Definition: DudleyAdapterException.h:74