class CorAssertHandler

Assertion checking mechanism

Inheritance:


Public Methods

CorAssertHandler ()
VLT On-line Data Flow, Subsystem: core
$Id: cor_assert_handler

Documentation

Assertion checking mechanism
CorAssertHandler()
VLT On-line Data Flow, Subsystem: core
$Id: cor_assert_handler.h,v 1.5 1997/04/11 13:32:06 mwiedmer Exp $

SYNOPSIS

    #include <cor_assert_handler.h> 

    CorAssertHandler handler;
  

DESCRIPTION
You can write your own assertion handling function, and tell the assertion system to call it whenever an assertion is violated. The function must take one of two forms:

1. No arguments

    void <handler>();
  
If an assertion fires, an error message is printed to standard output, then the application handler is called.

2. Arguments

    void <handler>(const char* file, int line, const char* explanation);
  
If an assertion fires, the application handler is called. The first argument is the name of the file in which the assertion appears; the second argument is the line number of the assertion within the file; the third argument is the 'explanation' which appears in the assert macro.

Tell the assertion system to use your handler via the call

    corAssertHandler.set(<handler>);
  

If you want to save the handler previously used, do this:

    CorAssertHandler old = corAssertHandler.set(<handler>);
  
after which 'old' can be subsequently used as an argument to corAssertHandler.set() if desired.

To resume default behaviour:

     corAssertHandler.cancel();
  
or
     CorAssertHandler old = corAssertHandler.cancel();
  

If no handler is set, your program will abort.

SEE ALSO
COR_ASSERT


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de