Utils::ErrorManager Class Reference

This is an EXTREMELY simple error management interface. More...

#include <utils.h>

List of all members.

Classes

struct  ErrorEvent
 Groups together information pertinent to one error occurrence. More...

Public Types

enum  eErrorType {
  ErrorType_Assert, ErrorType_Params, ErrorType_Instance, ErrorType_Internal,
  ErrorType_Unknown
}
 Defines known/common error types. More...

Static Public Member Functions

static void Start (int a_nErrorHeapSize)
 Starts error management services You must call this function BEFORE any other error function.
static void Stop ()
 Stops error management services You must call this function right before your program ends.
static void Report (eErrorType a_nType, EclipseObject *a_pObject, const char *a_sDsc,...)
 Reports an error in our heap If an object is passed, its reference count will increase by 1.
static int GetErrorCount ()
 Returns the current number of active errors in the heap.
static void Clear ()
 Clears our error heap Deletes all the errors contained in our heap and all their intermediate data.
static ErrorEventGetError (int a_nIndex)
 Access a particular error from our heap Returns an error object from our heap, or null if the index is unknown.


Detailed Description

This is an EXTREMELY simple error management interface.

A static utility for reporting global errors.

It just tracks the last n error messages, and the objects that generated them. At any point in time you can check to see if someone raised the error flag, and then access the offending objects.

Author:
Dan Torres 12/17/2008

Definition at line 57 of file utils.h.


Member Enumeration Documentation

Defines known/common error types.

Enumerator:
ErrorType_Assert  Something should never had happened (program error).
ErrorType_Params  Wrong parameters.
ErrorType_Instance  Failed to instantiate something.
ErrorType_Internal  Something just failed to work.
ErrorType_Unknown  We don't know. But its wrong.

Definition at line 69 of file utils.h.


Member Function Documentation

static ErrorEvent* Utils::ErrorManager::GetError ( int  a_nIndex  )  [static]

Access a particular error from our heap Returns an error object from our heap, or null if the index is unknown.

If the index is greater than the number of errors in the heap, the last valid error is returned.

Parameters:
a_nIndex zero-based index for our heap.

static int Utils::ErrorManager::GetErrorCount (  )  [static]

Returns the current number of active errors in the heap.

Returns:
zero or more errors

static void Utils::ErrorManager::Report ( eErrorType  a_nType,
EclipseObject a_pObject,
const char *  a_sDsc,
  ... 
) [static]

Reports an error in our heap If an object is passed, its reference count will increase by 1.

Parameters:
a_nType Error classification
a_pObject The object where the error takes place.
a_sDesc A brief description of the error, followed by any formatting params

static void Utils::ErrorManager::Start ( int  a_nErrorHeapSize  )  [static]

Starts error management services You must call this function BEFORE any other error function.

Parameters:
a_nErrorHeapSize Size of the error heap (number of error messages to keep)


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

Generated on Tue Jan 20 17:58:02 2009 for EclipseRay by  doxygen 1.5.7.1