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