HImErrorHandler
-
class
HImErrorHandler The
HImErrorHandlerclass implements a set of rules for when info/warnings/errors should be passed to the user.The
HImErrorHandlerallows 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
HImErrorHandlerto 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; andBlock()can be used to block even the first instance of a message. BothPass()andBlock()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 bothBlock()andPass()will be passed.The most common usage is expected to be to simply register it with default settings just to avoid duplicates.
Methods
-
static bool
HImErrorHandler::IsBlocked(int category, int specific, int severity) private static
-
static bool
HImErrorHandler::IsPassed(int category, int specific, int severity) private static
-
HImErrorHandler::HImErrorHandler(bool BlockByDefault = false) Constructor an
HImErrorHandlerobject.Parameters
BlockByDefault: Pass true if you want to block all error messages by default if they haven’t been identified as blocked or passed.
-
HImErrorHandler::~HImErrorHandler()
-
void
HImErrorHandler::SetBlockByDefault(bool bbd) This method sets the behavior of the all errors not otherwise specified.
Parameters
bbd: Pass true to block by default or false to pass by default.
-
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.
-
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
cat: The category number.
spec: The specific number.
sev: The severity number.
-
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
cat: The category number.
spec: The specific number.
sev: The severity number.
-
static bool
HImErrorHandler::BlockByDefault() static
Returns
True if error messages are block by default unless specified otherwise or false if they are passed.
-
static void
HImErrorHandler::CallbackEntryPoint(int category, int specific, int severity, int msgc, char const *const *msgv, int stackc, char const *const *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.
Variables
-
HErrorDescriptorNode *
HImErrorHandler::m_Block private static
HErrorDescriptorNode
-
HErrorDescriptorNode *
HImErrorHandler::m_Pass private static
HErrorDescriptorNode
-
bool
HImErrorHandler::m_BlockByDefault private static
bool