Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

nci/suif/suif2b/basesuif/suifkernel/suifkernel_messages.h File Reference

Macros for assertions, warnings and errors. More...

#include "suifkernel_forwarders.h"

Go to the source code of this file.

Compounds

class  SuifKernelMessage

Defines

#define SUIF_MODULE   "Unknown"
#define suif_assert( expr )    if (expr) ; else SuifKernelMessage::create( __FILE__, __LINE__, SUIF_MODULE ).assert_message("")
 Assert that the expression is true. More...

#define suif_assert_message( expr, params )    if (expr) ; else SuifKernelMessage::create( __FILE__, __LINE__, SUIF_MODULE ).assert_message params
 Assert that the expression is true. More...

#define suif_assert_on_object( expr, obj )    if (expr) ; else SuifKernelMessage::create( __FILE__, __LINE__, SUIF_MODULE ).assert_message_on_object("", obj) ;
 Assert that the expression is true. More...

#define suif_assert_message_on_object( expr, params )    if (expr) ; else SuifKernelMessage::create( __FILE__, __LINE__, SUIF_MODULE ).assert_message_on_object params ;
 Assert that the expression is true. More...

#define suif_error   delete SuifKernelMessage::create( __FILE__, __LINE__, SUIF_MODULE ).error
 An error has occurred. More...

#define suif_warning   delete SuifKernelMessage::create( __FILE__, __LINE__, SUIF_MODULE ).warning
 An unexpected event has occurred that can be dealt with in a safe way print a message about it to warn the user that there is a problem but processing can continue. More...

#define suif_information   delete SuifKernelMessage::create( __FILE__, __LINE__, SUIF_MODULE ).information
 Print information pertaining to a given SuifObject or environment. More...


Detailed Description

Macros for assertions, warnings and errors.

Define Documentation

#define SUIF_MODULE   "Unknown"

#define suif_assert( expr)   if (expr) ; else SuifKernelMessage::create( __FILE__, __LINE__, SUIF_MODULE ).assert_message("")

Assert that the expression is true.

If it is not, expect the system to halt

This macro was designed so that if it is redefined to ignore assertions, there will be no performance penalty. (and no checking)

Usage:
 suif_assert( value == 0 );

#define suif_assert_message( expr,
params)   if (expr) ; else SuifKernelMessage::create( __FILE__, __LINE__, SUIF_MODULE ).assert_message params

Assert that the expression is true.

If it is not, print a message

This macro was designed so that if it is redefined to ignore assertions, there will be no performance penalty. (and no checking)

Usage:
 suif_assert_message( value == 0, ("Value(%d) != 0\n", value))

#define suif_assert_message_on_object( expr,
params)   if (expr) ; else SuifKernelMessage::create( __FILE__, __LINE__, SUIF_MODULE ).assert_message_on_object params ;

Assert that the expression is true.

If it is not, print a message that contains information about a relevant object and some other user-defined code.

This macro was designed so that if it is redefined to ignore assertions, there will be no performance penalty. (and no checking)

Usage:
 suif_assert_message_on_object( value == 0, ( suif_obj, "message %s", str) );

#define suif_assert_on_object( expr,
obj)   if (expr) ; else SuifKernelMessage::create( __FILE__, __LINE__, SUIF_MODULE ).assert_message_on_object("", obj) ;

Assert that the expression is true.

If it is not, print a message that contains information about a relevant object

This macro was designed so that if it is redefined to ignore assertions, there will be no performance penalty. (and no checking)

Usage:
 suif_assert_on_object( value == 0, suif_obj );

#define suif_error   delete SuifKernelMessage::create( __FILE__, __LINE__, SUIF_MODULE ).error

An error has occurred.

print a message, possibly about a suifobject that it occurred on Expect that the system may stop.

Usage:
 suif_error("error message %s", str)
 suif_error(suif_env, "error message %s", str)
 suif_error(suif_obj, "error message %s", str)

#define suif_information   delete SuifKernelMessage::create( __FILE__, __LINE__, SUIF_MODULE ).information

Print information pertaining to a given SuifObject or environment.

Usage:
 suif_information("info message %s", str)
 suif_information(suif_env, "info message %s", str)
 suif_information(suif_obj, "info message %s", str)

#define suif_warning   delete SuifKernelMessage::create( __FILE__, __LINE__, SUIF_MODULE ).warning

An unexpected event has occurred that can be dealt with in a safe way print a message about it to warn the user that there is a problem but processing can continue.

Usage:
 suif_warning("warning message %s", str)
 suif_warning(suif_env, "warning message %s", str)
 suif_warning(suif_obj, "warning message %s", str)

Generated at Mon Jul 31 13:41:35 2000 for NCI SUIF by doxygen 1.1.2 written by Dimitri van Heesch, © 1997-2000