sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(- * * ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
* Name : exception
|
sl@0
|
16 |
* Part of : standard c++ library.
|
sl@0
|
17 |
*
|
sl@0
|
18 |
*/
|
sl@0
|
19 |
|
sl@0
|
20 |
|
sl@0
|
21 |
|
sl@0
|
22 |
|
sl@0
|
23 |
#ifndef _SYMCPP_EXCEPTION_H_
|
sl@0
|
24 |
#define _SYMCPP_EXCEPTION_H_
|
sl@0
|
25 |
|
sl@0
|
26 |
#ifdef __EABI__
|
sl@0
|
27 |
/* EABI specific definitions */
|
sl@0
|
28 |
#include <e32def.h>
|
sl@0
|
29 |
namespace std
|
sl@0
|
30 |
{
|
sl@0
|
31 |
class exception
|
sl@0
|
32 |
{
|
sl@0
|
33 |
public:
|
sl@0
|
34 |
IMPORT_C exception() __NO_THROW;
|
sl@0
|
35 |
IMPORT_C exception(const exception&) __NO_THROW;
|
sl@0
|
36 |
IMPORT_C exception& operator=(const exception&) __NO_THROW;
|
sl@0
|
37 |
IMPORT_C virtual ~exception() __NO_THROW;
|
sl@0
|
38 |
IMPORT_C virtual const char* what() const __NO_THROW;
|
sl@0
|
39 |
};
|
sl@0
|
40 |
|
sl@0
|
41 |
class bad_exception : public exception
|
sl@0
|
42 |
{
|
sl@0
|
43 |
public:
|
sl@0
|
44 |
IMPORT_C bad_exception() __NO_THROW;
|
sl@0
|
45 |
IMPORT_C bad_exception(const bad_exception&) __NO_THROW;
|
sl@0
|
46 |
IMPORT_C bad_exception& operator=(const bad_exception&) __NO_THROW;
|
sl@0
|
47 |
IMPORT_C virtual ~bad_exception() __NO_THROW;
|
sl@0
|
48 |
IMPORT_C virtual const char* what() const __NO_THROW;
|
sl@0
|
49 |
};
|
sl@0
|
50 |
|
sl@0
|
51 |
typedef void (*unexpected_handler)();
|
sl@0
|
52 |
|
sl@0
|
53 |
IMPORT_C unexpected_handler set_unexpected(unexpected_handler) __NO_THROW;
|
sl@0
|
54 |
IMPORT_C void unexpected();
|
sl@0
|
55 |
|
sl@0
|
56 |
typedef void (*terminate_handler)();
|
sl@0
|
57 |
|
sl@0
|
58 |
IMPORT_C terminate_handler set_terminate(terminate_handler) __NO_THROW;
|
sl@0
|
59 |
IMPORT_C void terminate();
|
sl@0
|
60 |
|
sl@0
|
61 |
IMPORT_C extern bool uncaught_exception() __NO_THROW;
|
sl@0
|
62 |
}
|
sl@0
|
63 |
|
sl@0
|
64 |
|
sl@0
|
65 |
|
sl@0
|
66 |
# else
|
sl@0
|
67 |
|
sl@0
|
68 |
/* Declarations common to all other platforms (Non-EABI) here.
|
sl@0
|
69 |
* WINSCW specific definitions are in exception_winscw.h
|
sl@0
|
70 |
*/
|
sl@0
|
71 |
# include <e32def.h>
|
sl@0
|
72 |
|
sl@0
|
73 |
namespace std {
|
sl@0
|
74 |
|
sl@0
|
75 |
class exception {
|
sl@0
|
76 |
public:
|
sl@0
|
77 |
exception() __NO_THROW;
|
sl@0
|
78 |
exception(const exception&) __NO_THROW;
|
sl@0
|
79 |
exception& operator=(const exception&) __NO_THROW;
|
sl@0
|
80 |
virtual ~exception() __NO_THROW;
|
sl@0
|
81 |
virtual const char* what() const __NO_THROW;
|
sl@0
|
82 |
};
|
sl@0
|
83 |
|
sl@0
|
84 |
class bad_exception : public exception {
|
sl@0
|
85 |
public:
|
sl@0
|
86 |
bad_exception() __NO_THROW;
|
sl@0
|
87 |
bad_exception(const bad_exception&) __NO_THROW;
|
sl@0
|
88 |
bad_exception& operator=(const bad_exception&) __NO_THROW;
|
sl@0
|
89 |
virtual ~bad_exception() __NO_THROW;
|
sl@0
|
90 |
virtual const char* what() const __NO_THROW;
|
sl@0
|
91 |
};
|
sl@0
|
92 |
|
sl@0
|
93 |
typedef void (*terminate_handler)();
|
sl@0
|
94 |
extern terminate_handler set_terminate(terminate_handler) __NO_THROW;
|
sl@0
|
95 |
|
sl@0
|
96 |
typedef void (*unexpected_handler)();
|
sl@0
|
97 |
extern unexpected_handler set_unexpected(unexpected_handler) __NO_THROW;
|
sl@0
|
98 |
|
sl@0
|
99 |
void terminate();
|
sl@0
|
100 |
void unexpected();
|
sl@0
|
101 |
bool uncaught_exception() __NO_THROW;
|
sl@0
|
102 |
|
sl@0
|
103 |
}
|
sl@0
|
104 |
|
sl@0
|
105 |
# ifdef __WINSCW__
|
sl@0
|
106 |
/*
|
sl@0
|
107 |
* C++ Exception specific stuff required from the CW runtime.
|
sl@0
|
108 |
* Certain functions are implemented inline in CW headers.
|
sl@0
|
109 |
* We're providing the same in exception_winscw.h
|
sl@0
|
110 |
*/
|
sl@0
|
111 |
# include <stdapis/stlportv5/exception_winscw.h>
|
sl@0
|
112 |
# endif //__WINSCW__
|
sl@0
|
113 |
|
sl@0
|
114 |
#endif // __EABI__
|
sl@0
|
115 |
#endif //_SYMCPP_EXCEPTION_
|
sl@0
|
116 |
|