Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CP_ErrorManager Class Reference

A class to handle reporting of all error conditions in a CPLAT application. More...

Inheritance diagram for CP_ErrorManager:

CP_NoCopy List of all members.

Public Member Functions

Constructor / Destructor
 CP_ErrorManager ()
 Constructor.
virtual ~CP_ErrorManager ()
 Destructor.
Exceptions
void ReportException (const CP_String &inMessage, const std::exception &inException, const char *inFunction, int inLine, const char *inFile)
Errors
void ReportError (const CP_String &inMessage, const char *inFunction, int inLine, const char *inFile)
void ReportError (const CP_String &inMessage, const CP_String &inDescription, const char *inFunction, int inLine, const char *inFile)
Reporting
void ReportError (const CP_String &inMessage, const CP_String &inDescription)
void ReportException_OS (const CP_String &inMessage, const std::exception &inException, const char *inFunction, int inLine, const char *inFile)
void ReportWarning (const CP_String &inMessage, const CP_String &inDescription)
Warnings
void ReportWarning (const CP_String &inMessage, const char *inFunction, int inLine, const char *inFile)
void ReportWarning (const CP_String &inMessage, const CP_String &inDescription, const char *inFunction, int inLine, const char *inFile)
Notifications
void SurpressAlertNotifications (CP_Debugging::CP_E_DebugNotification inNotifiction=CP_Debugging::CP_E_DebugNotification_Nothing)
void RestoreAlertNotifications ()

Static Public Member Functions

Instance
static CP_ErrorManagerInstance ()

Private Attributes

CP_Debugging::CP_E_DebugNotification fSavedExceptionNotification
CP_Debugging::CP_E_DebugNotification fSavedErrorNotification
CP_Debugging::CP_E_DebugNotification fSavedWarningNotification

Static Private Attributes

static CP_ErrorManagerfsInstance = NULL

Detailed Description

This is the single class that is responsible for all error reporting in CPLAT. You can set the actual routine that gets called when an error is reported to your own, or use the default error reporting routines which display an alert to the user.


Constructor & Destructor Documentation

CP_ErrorManager::CP_ErrorManager  ) 
 

Constructor.

Exceptions:
none 

CP_ErrorManager::~CP_ErrorManager  )  [virtual]
 

Destructor.

Exceptions:
none 


Member Function Documentation

CP_ErrorManager * CP_ErrorManager::Instance  )  [static]
 

Returns the single instance of this class.

Exceptions:
none 
Returns:
CP_ErrorManager * Returns the single instance of this class.

void CP_ErrorManager::ReportException const CP_String inMessage,
const std::exception &  inException,
const char *  inFunction,
int  inLine,
const char *  inFile
 

Routine called to report an exception to the user.

Parameters:
inMessage CP_String with the message to be shown.
inException std::exception or CPLAT derrived exception class that we are reporting information about.
inFunction Function that called this method.
inLine Line number of file that called this method.
inFile File of function that called this method.
Exceptions:
none 
Returns:
void

void CP_ErrorManager::ReportError const CP_String inMessage,
const char *  inFunction,
int  inLine,
const char *  inFile
 

Routine called to report an error to the user.

Parameters:
inMessage CP_String with the message to be shown.
inFunction Function that called this method.
inLine Line number of file that called this method.
inFile File of function that called this method.
Exceptions:
none 
Returns:
void

void CP_ErrorManager::ReportError const CP_String inMessage,
const CP_String inDescription,
const char *  inFunction,
int  inLine,
const char *  inFile
 

Routine called to report an error to the user. This also allows the passing in of a description.

Parameters:
inMessage CP_String with the message to be shown.
inDescription CP_String with a description that is also shown.
inFunction Function that called this method.
inLine Line number of file that called this method.
inFile File of function that called this method.
Exceptions:
none 
Returns:
void

void CP_ErrorManager::ReportError const CP_String inMessage,
const CP_String inDescription
 

MacOS implementation of the ReportError method.

Parameters:
inMessage CP_String containing the message to be displayed.
inDescription CP_String containing the description to be displayed below the message.
Exceptions:
none 
Returns:
void

void CP_ErrorManager::ReportException_OS const CP_String inMessage,
const std::exception &  inException,
const char *  inFunction,
int  inLine,
const char *  inFile
 

MacOS implementation of the ReportException method that is used to report information about the passed in exception.

Parameters:
inMessage CP_String containing the message to be displayed.
inException std::exception class that we will display information about. This will call the exceptions what() method to get the text to be used for the description.
inFunction The name of the function that called us.
inLine Line number in file that called us.
inFile File that called us.
Exceptions:
none 
Returns:
void

void CP_ErrorManager::ReportWarning const CP_String inMessage,
const CP_String inDescription
 

MacOS implementation of the ReportWarning method.

Parameters:
inMessage CP_String containing the message to be displayed.
inDescription CP_String containing the description to be displayed below the message.
Exceptions:
none 
Returns:
void

void CP_ErrorManager::ReportWarning const CP_String inMessage,
const char *  inFunction,
int  inLine,
const char *  inFile
 

Routine called to report a warning to the user.

Parameters:
inMessage CP_String with the message to be shown.
inFunction Function that called this method.
inLine Line number of file that called this method.
inFile File of function that called this method.
Exceptions:
none 
Returns:
void

void CP_ErrorManager::ReportWarning const CP_String inMessage,
const CP_String inDescription,
const char *  inFunction,
int  inLine,
const char *  inFile
 

Routine called to report a warning to the user. This also allows the passing in of a description.

Parameters:
inMessage CP_string with the message to be shown.
inDescription CP_String with a description that is also shown.
inFunction Function that called this method.
inLine Line number of file that called this method.
inFile File of function that called this method.
Exceptions:
none 
Returns:
void

void CP_ErrorManager::SurpressAlertNotifications CP_Debugging::CP_E_DebugNotification  inNotifiction = CP_Debugging::CP_E_DebugNotification_Nothing  ) 
 

Called when you want to surpress the existing notifications of alerts. This will save the current state so it can be restored in RestoreAlertNotifications. The default passes in CP_E_DebugNotification_Nothing so that nothing is reported, however you can pass in a different value if you want to temporarily chnge the current state of how notifications are handled.

Parameters:
inNotifiction The current notification state.
Exceptions:
none 
Returns:
void

void CP_ErrorManager::RestoreAlertNotifications  ) 
 

Called when you want to restore the existing notifications of alerts. This will restore the current state to that when SurpressAlertNotifications was called.

Exceptions:
none 
Returns:
void


Member Data Documentation

CPLAT_Begin_Namespace_CPLAT CP_ErrorManager * CP_ErrorManager::fsInstance = NULL [static, private]
 

CP_Debugging::CP_E_DebugNotification CP_ErrorManager::fSavedExceptionNotification [private]
 

CP_Debugging::CP_E_DebugNotification CP_ErrorManager::fSavedErrorNotification [private]
 

CP_Debugging::CP_E_DebugNotification CP_ErrorManager::fSavedWarningNotification [private]
 


The documentation for this class was generated from the following files:
Generated on Tue Sep 20 20:21:42 2005 for CPLAT_MacOS by  doxygen 1.4.0