BlitzMax Extended  0.8.11
Pushing Blitz to the Max.
blitz_exception.h
Go to the documentation of this file.
00001 
00010 #ifndef BLITZ_EX_EXCEPTION_H
00011 #define BLITZ_EX_EXCEPTION_H
00012 
00013 #include "_common.h"
00014 
00015 BB_BEGIN_DECLS
00016 
00025 struct BBException
00026 {
00033     BBClass         *clas;
00034     
00035     int             refs;
00036     
00044     BBException     *cause;
00045 };
00046 
00047 //  For internal usage only
00048 enum bb_exception_vfnkey_e
00049 {
00050     __BBEXCEPTION_VFN_INITCAUSE__,  
00051     __BBEXCEPTION_VFN_GETCAUSE__
00052 };
00053 
00054 struct bb_exception_vfns_s
00055 {
00056     // Initializes an exception's cause using its own class' virtual function
00057     void            (*InitCause)(BBException *ex, BBException *cause);  
00058     
00059     // Gets an exception's cause using its own class' virtual function
00060     BBException*    (*GetCause)(BBException *ex);
00061 };
00062 
00063 typedef struct bb_exception_vfns_s  __BBExceptionVfns;
00064 
00065 extern BBClass bbExceptionClass;
00066 
00067 void bbExceptionCtor(BBException *ex);
00068 void bbExceptionDtor(BBException *ex);
00069 
00070 BBInt bbExceptionCompare(const BBException *ex, const BBException *rhs);
00071 BBException* bbExceptionClone(BBException *ex);
00072 
00080 BBException* bbExceptionGetCause(const BBException *ex);
00081 
00094 void bbExceptionInitCause(BBException *ex, BBException *cause);
00095 
00096 BB_END_DECLS
00097 
00098 #endif  // BLITZ_EX_EXCEPTION_H