1 ///////////////////////////////////////////////////////////
2 // Softwarebauelemente II, Aufgabe C1.1
3 //
4 // author: Stephan Brumme
5 // last changes: July 3, 2001
6
7
8 #if !defined(AFX_EXCEPTION_H__183BDBA1_545F_11D5_9BB8_A7F13DB29851__INCLUDED_)
9 #define AFX_EXCEPTION_H__183BDBA1_545F_11D5_9BB8_A7F13DB29851__INCLUDED_
10
11 #if _MSC_VER > 1000
12 #pragma once
13 #endif // _MSC_VER > 1000
14
15 #include "BasicClass.h"
16
17 class CException : public CBasicClass
18 {
19 public:
20 // construct new exception
21 CException();
22 CException(const string strError, const CBasicClass* pSource);
23 CException(const CException& exception);
24 virtual ~CException() {};
25
26 // return class name
27 virtual string ClassnameOf() const { return "CException"; }
28
29 // display the attributes
30 virtual string Show() const;
31 // only for internal purposes !
32 virtual string ShowDebug() const;
33
34 // validate an exception
35 virtual bool ClassInvariant() const;
36
37 // compare two exceptions
38 bool operator==(const CException& house) const;
39 virtual bool EqualValue(const CBasicClass* pClass) const;
40
41 // copy one exception to another one
42 CException& operator=(const CException &house);
43 virtual bool Copy(const CBasicClass* pClass);
44
45 private:
46 string m_strError;
47 const CBasicClass* m_pSource;
48 };
49
50 #endif // !defined(AFX_EXCEPTION_H__183BDBA1_545F_11D5_9BB8_A7F13DB29851__INCLUDED_)
51
52