User Documentation
RAVL, Recognition And Vision Library
DEVELOP HOME PAGE CLASS LIST CONTENTS
Ravl - Core - Error Handling


Error reporting, Exceptions and Asserted invariants.

There are several macros which you can use for checking invariants in your program, much like 'assert(...)' in 'C'. They are defined in 'Ravl/Assert.hh'.

   #include "Ravl/Assert.hh"

The two main macros are :

   RavlAssert(..condition..);

which will stop the program if 'condition' is false. The is also

   RavlAssertMsg(..condition..,..msg..);

which allows an extra message to the assertion to help developers track down problems in their code. Asserts are NOT checked in optimised code they are re-defined to empty statements. If you want to assert a condition in all compile modes use the RavlAlwaysAssert and RavlAlwaysAssertMsg macro's shown below.    RavlAlwaysAssert(..condition..);

   RavlAlwaysAssertMsg(..condition..,..msg..);

Normal classes:

 ExceptionC RAVL Exception.
 ExceptionErrorCastC Casting exception class.
 ExceptionOperationFailedC Exception: Operation Failed
 ExceptionOutOfRangeC Exception: Out of Range
 ExceptionAssertionFailedC Exception: Assertion Failed
 ExceptionNumericalC Exception: Numerical exception.
 ExceptionEndOfStreamC Exception thrown when end of stream found.

Normal functions:

 AssertThrowException(void) Test if an exception on an assertion failure.
 SetAssertThrowException(bool) Throw an exception on an assertion failure.
 AssertFailed(char *,int) Called if assertion failed.
 AssertFailed(char *,int,char *) Called if assertion failed, with message.
 IssueError(char *,int,char *,...) Call when program encounters an error.
 IssueWarning(char *,int,char *,...) Call when program encounters an a unexpected occurance.
Maintainer:Charles Galambos, Documentation by CxxDoc: Tue Aug 13 10:00:52 2002