The HImErrorHandler class implements a set of rules for when info/warnings/errors should be passed to the user. More...

#include <HImErrorHandler.h>

Public Member Functions

 HImErrorHandler (bool BlockByDefault=false)
 
void SetBlockByDefault (bool bbd)
 

Static Public Member Functions

static void Block (int cat, int spec, int sev)
 
static bool BlockByDefault ()
 
static void CallbackEntryPoint (int category, int specific, int severity, int msgc, char *msgv[], int stackc, char *stackv[])
 
static void Pass (int cat, int spec, int sev)
 
static void RegisterCallbacks ()
 

Detailed Description

The HImErrorHandler class implements a set of rules for when info/warnings/errors should be passed to the user.

The HImErrorHandler allows for a more sophisticated scheme of prompting the user when necessary. For most warnings and errors, HOOPS does not retain the information that the user has already seen that message or one like it. The result is that the error messages can be duplicated to the point of making an application unusable. The alternative is to turn info/warnings/errors off (see #HC_Define_System_Options), but that is too broad a brush as it can cause potentially serious problems to be missed.

In addition to the information string that the user sees, HOOPS error messages are identified by 3 integers: category, specific, and severity. The default behavior is for the HImErrorHandler to pass each combination of 3 integers exactly once during the execution of the application. Memory of what errors have already been given is kept in a linked list so that duplicates can be rejected. Additionally, Pass() can be used to specify that a certain error message always be passed; and Block() can be used to block even the first instance of a message. Both Pass() and Block() take the 3 identifying integers that describe an error, '-1' is a special value interpreted as a wild card that matches anything. For example, Pass( HEC_CALLBACK, -1, -1 ) would always pass any callback related bugs. Info/warnings/errors matched by both Block() and Pass() will be passed.

The most common usage is expected to be to simply register it with default settings just to avoid duplicates.

Constructor & Destructor Documentation

◆ HImErrorHandler()

HImErrorHandler::HImErrorHandler ( bool  BlockByDefault = false)

Constructor an HImErrorHandler object.

Parameters
BlockByDefaultPass true if you want to block all error messages by default if they haven't been identified as blocked or passed.

Member Function Documentation

◆ Block()

static void HImErrorHandler::Block ( int  cat,
int  spec,
int  sev 
)
static

This method specifies the errors to always block. This includes errors that we may not have even seen before.

Parameters
catThe category number.
specThe specific number.
sevThe severity number.

◆ BlockByDefault()

static bool HImErrorHandler::BlockByDefault ( )
inlinestatic
Returns
True if error messages are block by default unless specified otherwise or false if they are passed.

◆ CallbackEntryPoint()

static void HImErrorHandler::CallbackEntryPoint ( int  category,
int  specific,
int  severity,
int  msgc,
char *  msgv[],
int  stackc,
char *  stackv[] 
)
static

This is the callback that is registered with HOOPS and handles the passing and blocking of errors. It must be static to be registered as a callback.

◆ Pass()

static void HImErrorHandler::Pass ( int  cat,
int  spec,
int  sev 
)
static

This method specifies the errors to pass on. This includes errors that we may not have seen before.

Parameters
catThe category number.
specThe specific number.
sevThe severity number.

◆ RegisterCallbacks()

static void HImErrorHandler::RegisterCallbacks ( )
static

This method gives HOOPS pointers to the functions want to intercept.
This function should be called just once, at the beginning of execution.

◆ SetBlockByDefault()

void HImErrorHandler::SetBlockByDefault ( bool  bbd)
inline

This method sets the behavior of the all errors not otherwise specified.

Parameters
bbdPass true to block by default or false to pass by default.

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