~vcs-imports/escript-finley/trunk

« back to all changes in this revision

Viewing changes to dudley/src/CPPAdapter/DudleyAdapterException.h

  • Committer: jfenwick
  • Date: 2010-10-11 01:48:14 UTC
  • Revision ID: svn-v4:77569008-7704-0410-b7a0-a92fef0b09fd:trunk:3259
Merging dudley and scons updates from branches

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/*******************************************************
 
3
*
 
4
* Copyright (c) 2003-2010 by University of Queensland
 
5
* Earth Systems Science Computational Center (ESSCC)
 
6
* http://www.uq.edu.au/esscc
 
7
*
 
8
* Primary Business: Queensland, Australia
 
9
* Licensed under the Open Software License version 3.0
 
10
* http://www.opensource.org/licenses/osl-3.0.php
 
11
*
 
12
*******************************************************/
 
13
 
 
14
 
 
15
#if !defined  dudley_DudleyAdapterException_20040526_H
 
16
#define dudley_DudleyAdapterException_20040526_H
 
17
#include "system_dep.h"
 
18
 
 
19
#include "esysUtils/EsysException.h"
 
20
 
 
21
namespace dudley
 
22
{
 
23
 
 
24
  /**
 
25
  \brief
 
26
  DudleyAdapterException exception class.
 
27
 
 
28
  Description:
 
29
  DudleyAdapterException exception class.
 
30
  The class provides a public function returning the exception name
 
31
  */
 
32
  class DudleyAdapterException : public esysUtils::EsysException
 
33
  {
 
34
 
 
35
  protected:
 
36
 
 
37
     typedef EsysException Parent;
 
38
 
 
39
  public:
 
40
    /**
 
41
    \brief
 
42
    Default constructor for the exception.
 
43
    */
 
44
    DUDLEY_DLL_API
 
45
    DudleyAdapterException() : Parent() { updateMessage();}
 
46
    /**
 
47
    \brief
 
48
    Constructor for the exception.
 
49
    */
 
50
    DUDLEY_DLL_API
 
51
    DudleyAdapterException(const char *cstr) : Parent(cstr) { updateMessage();}
 
52
    /**
 
53
    \brief
 
54
    Constructor for the exception.
 
55
    */
 
56
    DUDLEY_DLL_API
 
57
    DudleyAdapterException(const std::string &str) :
 
58
    Parent(str) { updateMessage();}
 
59
    /**
 
60
    \brief
 
61
    Copy Constructor for the exception.
 
62
    */
 
63
    DUDLEY_DLL_API
 
64
    DudleyAdapterException(const DudleyAdapterException &other) : Parent(other)
 
65
      {
 
66
        updateMessage();
 
67
      }
 
68
 
 
69
    /// Destructor
 
70
    DUDLEY_DLL_API
 
71
    virtual ~DudleyAdapterException() THROW(NO_ARG) {}
 
72
 
 
73
    /**
 
74
    \brief
 
75
    Assignment operator.
 
76
    */
 
77
    DUDLEY_DLL_API
 
78
    inline DudleyAdapterException &
 
79
    operator=(const DudleyAdapterException &other ) THROW(NO_ARG)
 
80
       {
 
81
         Parent::operator=(other);
 
82
         updateMessage();
 
83
         return *this;
 
84
       }
 
85
 
 
86
    /**
 
87
    \brief
 
88
    Returns the name of the exception.
 
89
    */
 
90
    DUDLEY_DLL_API
 
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
#endif