2010-06-30 13:08:22 +00:00
|
|
|
|
|
|
|
struct _Unwind_Exception;
|
2010-06-30 15:59:52 +00:00
|
|
|
/**
|
|
|
|
* CXXException class implements a boxed C++ exception. This class should
|
|
|
|
* never be created directly by the user.
|
|
|
|
*
|
|
|
|
* When using libobjc2, you can catch C++ exceptions by declaring this class as
|
|
|
|
* a catch parameter, for example:
|
|
|
|
*
|
|
|
|
* @catch(CXXException *e)
|
|
|
|
*
|
|
|
|
* The caught instance will be autoreleased and does not need to be manually
|
|
|
|
* freed.
|
|
|
|
*/
|
2010-06-30 13:08:22 +00:00
|
|
|
@interface CXXException : NSObject
|
|
|
|
{
|
2010-07-01 07:17:53 +00:00
|
|
|
/** Exception object, as defined by the CodeSourcery exception ABI. */
|
|
|
|
struct _Unwind_Exception *ex;
|
2010-06-30 13:08:22 +00:00
|
|
|
}
|
2010-06-30 15:59:52 +00:00
|
|
|
/**
|
|
|
|
* Constructor called by the runtime.
|
|
|
|
*/
|
2010-07-01 07:17:53 +00:00
|
|
|
+ (id) exceptionWithForeignException: (struct _Unwind_Exception*)ex;
|
2010-06-30 15:59:52 +00:00
|
|
|
/**
|
|
|
|
* Returns a pointer to the thrown value. When a value is thrown in C++, it is
|
|
|
|
* copied into the exception structure. The real type of the pointee is the
|
|
|
|
* type of the object that was thrown.
|
|
|
|
*/
|
2010-07-01 07:17:53 +00:00
|
|
|
- (void*) thrownValue;
|
2010-06-30 15:59:52 +00:00
|
|
|
/**
|
|
|
|
* Returns a pointer to a std::type_info (C++) object defining the type of the
|
|
|
|
* value pointed to by the return from -thrownValue. You may compare this with
|
|
|
|
* the result of the typeinfo() operator in Objective-C++ to determine the type
|
|
|
|
* of the object.
|
|
|
|
*/
|
2010-07-01 07:17:53 +00:00
|
|
|
- (void*) cxx_type_info;
|
2010-06-30 15:59:52 +00:00
|
|
|
/**
|
|
|
|
* Rethrows the exception. Sending messages to this object after is has been
|
|
|
|
* rethrown has undefined behaviour.
|
|
|
|
*/
|
2010-07-01 07:17:53 +00:00
|
|
|
- (void) rethrow;
|
2010-06-30 13:08:22 +00:00
|
|
|
@end
|