FXException.h File Reference


Detailed Description

Defines macros and classes used in implementation of FOX exception generation & handling.

#include <string.h>
#include <errno.h>
#include <new>
#include "FXString.h"

Include dependency graph for FXException.h:

This graph shows which files directly or indirectly include this file:


Namespaces

namespace  FX

Defines

#define FXEXCEPTION_FILE(p)
#define FXEXCEPTION_FUNCTION(p)
#define FXEXCEPTION_LINE(p)
#define FXERRMAKE(e2, msg, code, flags)
#define FXERRH_THROW(e2)
#define FXERRG(msg, code, flags)
#define FXERRH(cond, msg, code, flags)
#define FXERRGOS(code, flags)
#define FXERRGOSFN(code, flags, filename)
#define FXERRHOS(exp)
#define FXERRHOSFN(exp, filename)
#define FXERRH_TRY
#define FXERRH_CATCH(e2)
#define FXERRH_REPORT(owner, e2)
#define FXERRH_ENDTRY
#define FXDELETE(v)
#define FXERRH_NODESTRUCTORMOD
#define FXEXCEPTIONDESTRUCT1
#define FXEXCEPTIONDESTRUCT2
#define FXEXCEPTION_STL1
#define FXEXCEPTION_STL2
#define FXEXCEPTION_FOXCALLING1
#define FXEXCEPTION_FOXCALLING2
#define FXERRGRANGE(msg, flags)
#define FXERRGPTR(flags)
#define FXERRHPTR(exp, flags)
#define FXERRGM
#define FXERRHM(exp)
#define FXERRGNOTSUPP(msg)
#define FXERRGNF(msg, flags)
#define FXERRGIO(msg)
#define FXERRHIO(exp)
#define FXERRGCONLOST(msg, flags)
#define FXERRGNOPERM(msg, flags)

Enumerations

enum  FXExceptionFlags {
  FX::FXERRH_ISFATAL, FX::FXERRH_ISNORETRY, FX::FXERRH_ISINFORMATIONAL, FX::FXERRH_ISFROMOTHER,
  FX::FXERRH_HASNESTED, FX::FXERRH_ISDEBUG, FX::FXERRH_ISFOXEXCEPTION, FX::FXERRH_ISFATAL,
  FX::FXERRH_ISNORETRY, FX::FXERRH_ISINFORMATIONAL, FX::FXERRH_ISFROMOTHER, FX::FXERRH_HASNESTED,
  FX::FXERRH_ISDEBUG, FX::FXERRH_ISFOXEXCEPTION
}
enum  FX::FXExceptionCodes {
  FX::FXEXCEPTION_USER, FXEXCEPTION_SYSCODE_BASE, FX::FXEXCEPTION_BADRANGE, FX::FXEXCEPTION_NULLPOINTER,
  FX::FXEXCEPTION_NORESOURCE, FX::FXEXCEPTION_NOMEMORY, FX::FXEXCEPTION_NOTSUPPORTED, FX::FXEXCEPTION_NOTFOUND,
  FX::FXEXCEPTION_IOERROR, FX::FXEXCEPTION_CONNECTIONLOST, FX::FXEXCEPTION_NOPERMISSION, FX::FXEXCEPTION_WINDOW,
  FX::FXEXCEPTION_IMAGE, FX::FXEXCEPTION_FONT, FX::FXEXCEPTION_OSSPECIFIC, FX::FXEXCEPTION_PYTHONERROR,
  FXEXCEPTION_INTTHREADCANCEL, FX::FXEXCEPTION_USER, FXEXCEPTION_SYSCODE_BASE, FX::FXEXCEPTION_BADRANGE,
  FX::FXEXCEPTION_NULLPOINTER, FX::FXEXCEPTION_NORESOURCE, FX::FXEXCEPTION_NOMEMORY, FX::FXEXCEPTION_NOTSUPPORTED,
  FX::FXEXCEPTION_NOTFOUND, FX::FXEXCEPTION_IOERROR, FX::FXEXCEPTION_CONNECTIONLOST, FX::FXEXCEPTION_NOPERMISSION,
  FX::FXEXCEPTION_WINDOW, FX::FXEXCEPTION_IMAGE, FX::FXEXCEPTION_FONT, FX::FXEXCEPTION_OSSPECIFIC,
  FX::FXEXCEPTION_PYTHONERROR, FXEXCEPTION_INTTHREADCANCEL
}

Functions

class FX::FXEXCEPTIONAPI (FXAPI) FXException
FXAPI FXStream & FX::operator<< (FXStream &s, const FXException &i)
FXAPI FXStream & FX::operator>> (FXStream &s, FXException &i)

Define Documentation

#define FXERRMAKE ( e2,
msg,
code,
flags   ) 

The preferred way to create a FXException, this constructs one into e2 with message msg, code code and flags being the usual exception flags

See also:
FX::FXExceptionFlags

#define FXERRH_THROW ( e2   ) 

Throws the specified exception.

#define FXERRG ( msg,
code,
flags   ) 

This combines a FXERRMAKE() with a FXERRH_THROW().

#define FXERRH ( cond,
msg,
code,
flags   ) 

This performs the assertion cond, which if false throws the specified exception.

Referenced by FX::FXCodeToPythonCode< vector, length >::allocate().

#define FXERRGOS ( code,
flags   ) 

Use this macro to generate a FXException representing the CLib/POSIX error code code. Flags are as for usual exceptions

See also:
FX::FXExceptionFlags

#define FXERRHOS ( exp   ) 

Use this macro to wrap POSIX, UNIX or CLib functions. On Win32, the includes anything in MSVCRT which sets errno

Referenced by FX::QMutex::QMutex().

#define FXERRH_TRY

Enters a section of code guarded against exceptions.

#define FXERRH_CATCH ( e2   ) 

Catches a specific exception.

#define FXERRH_REPORT ( owner,
e2   ) 

Parameters:
owner Either a FXApp or FXWindow
e2 The FXException to report Reports the exception e to the user
Note:
You must include "FXExceptionDialog.h" for this to compile
Warning:
You must be within a FXERRH_TRY...FXERRH_ENDTRY

#define FXERRH_ENDTRY

Ends the section of guarded code plus its exception handlers.

#define FXDELETE (  ) 

Deletes and zeros a variable so it won't get deleted again (usually a class member variable).

#define FXEXCEPTION_STL1

#define FXEXCEPTION_STL2

#define FXEXCEPTION_FOXCALLING1

Enters a section of code called by exception-unaware code eg; FOX GUI code.

#define FXEXCEPTION_FOXCALLING2

Exits a section of code called by exception-unaware code eg; FOX GUI code.

#define FXERRGRANGE ( msg,
flags   ) 

Returns:
A FX::FXRangeException
Use this macro to generically indicate a parameter exceeding the permitted range. As this is a common failure in all code, this should greatly help intuitive writing of handlers for this common error

#define FXERRHPTR ( exp,
flags   ) 

Returns:
A FX::FXPointerException
Use this macro to test for null pointers

#define FXERRHM ( exp   ) 

Returns:
A FX::FXMemoryException
Use this macro to wrap malloc, calloc and new eg;
  FXPtrHold ptr;
  FXERRHM(ptr=new Object());
Always doing this will correctly trap lack of memory and take the appropriate action

Referenced by FX::Generic::Functor< FX::Generic::TL::create< long, FX::FXObject *, FXuint, void * >::value >::copy(), FX::Generic::Functor< FX::Generic::TL::create< long, FX::FXObject *, FXuint, void * >::value >::Functor(), FX::FXIPCChannel::invokeMsgHandler(), FX::Generic::lockedAccessor< type >::lockedAccessor(), and FX::QMutex::QMutex().

#define FXERRGNOTSUPP ( msg   ) 

Returns:
A FX::FXNotSupportedException
Use this macro to indicate that an operation is not supported

#define FXERRGNF ( msg,
flags   ) 

Returns:
A FX::FXNotFoundException
Use this macro to generically indicate failures to find things. As this is a common failure in all code, this should greatly help intuitive writing of handlers for this common error

#define FXERRHIO ( exp   ) 

Returns:
A FX::FXIOException
Use this macro to wrap standard C library type calls eg;
  FXERRHIO(handle=open("foo.txt", O_CREAT));


(C) 2002-2008 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Jun 13 21:54:46 2008 for TnFOX by doxygen v1.5.6