ExceptionSink Class Reference

container for holding Qore-language exception information and also for registering a "thread_exit" call More...

#include <ExceptionSink.h>

List of all members.

Public Member Functions

DLLEXPORT ExceptionSink ()
 creates an empty ExceptionSink object
DLLEXPORT ~ExceptionSink ()
 calls ExceptionSink::defaultExceptionHandler() on all exceptions still present in the object and then deletes the exception list
DLLEXPORT void handleExceptions ()
 calls ExceptionSink::defaultExceptionHandler() on all exceptions still present in the object and then deletes the exception list
DLLEXPORT void handleWarnings ()
 calls ExceptionSink::defaultWarningHandler() on all exceptions still present in the object and then deletes the exception list
DLLEXPORT bool isEvent () const
 returns true if at least one exception is present or thread_exit has been triggered
DLLEXPORT bool isThreadExit () const
 returns true if thread_exit has been triggered
DLLEXPORT bool isException () const
 returns true if at least one exception is present
DLLEXPORT operator bool () const
 returns true if at least one exception is present or thread_exit has been triggered
DLLEXPORT class AbstractQoreNoderaiseException (const char *err, const char *fmt,...)
 appends a Qore-language exception to the list
DLLEXPORT AbstractQoreNoderaiseExceptionArg (const char *err, AbstractQoreNode *arg, const char *fmt,...)
 appends a Qore-language exception to the list, and sets the 'arg' member (this object takes over the reference count of 'arg')
DLLEXPORT AbstractQoreNoderaiseException (const char *err, QoreStringNode *desc)
 appends a Qore-language exception to the list; takes owenership of the "desc" argument reference
DLLEXPORT void raiseThreadExit ()
 sets the "thread_exit" flag; will cause the current thread to terminate
DLLEXPORT void assimilate (ExceptionSink *xs)
 assimilates all entries of the "xs" argument by appending them to the internal list and deletes the "xs" argument
DLLEXPORT void outOfMemory ()
 intended to be used to handle out of memory errors FIXME: not yet fully implemented
DLLEXPORT void clear ()
 deletes the exception list immediately


Detailed Description

container for holding Qore-language exception information and also for registering a "thread_exit" call

Member Function Documentation

DLLEXPORT ExceptionSink::operator bool (  )  const

returns true if at least one exception is present or thread_exit has been triggered

Intended as a alternative to isEvent()

          ExceptionSink xsink;
          if (xsink) { .. }

DLLEXPORT class AbstractQoreNode* ExceptionSink::raiseException ( const char *  err,
const char *  fmt,
  ... 
)

appends a Qore-language exception to the list

The AbstractQoreNode pointer returned is always 0; used to simplify error handling code.

Parameters:
err the exception code string
fmt the format string for the description for the exception
Returns:
always returns 0

DLLEXPORT AbstractQoreNode* ExceptionSink::raiseExceptionArg ( const char *  err,
AbstractQoreNode arg,
const char *  fmt,
  ... 
)

appends a Qore-language exception to the list, and sets the 'arg' member (this object takes over the reference count of 'arg')

The AbstractQoreNode pointer returned is always 0; used to simplify error handling code.

Parameters:
err the exception code string
arg the 'arg' member of the Qore-language exception object; will be dereferenced when the QoreException object is destroyed
fmt the format string for the description for the exception
Returns:
always returns 0

DLLEXPORT AbstractQoreNode* ExceptionSink::raiseException ( const char *  err,
QoreStringNode desc 
)

appends a Qore-language exception to the list; takes owenership of the "desc" argument reference

The AbstractQoreNode pointer returned is always 0; used to simplify error handling code.

Parameters:
err the exception code string
desc the description string for the exception; the ExceptionSink argument takes ownership of the reference count
Returns:
always returns 0


The documentation for this class was generated from the following file:

Generated on Mon Oct 26 09:09:49 2009 for Qore Programming Language by  doxygen 1.5.6