00001 // 00002 // Copyright (c) 2000 by Tech Soft 3D, LLC. 00003 // The information contained herein is confidential and proprietary to 00004 // Tech Soft 3D, LLC., and considered a trade secret as defined under 00005 // civil and criminal statutes. Tech Soft 3D shall pursue its civil 00006 // and criminal remedies in the event of unauthorized use or misappropriation 00007 // of its trade secrets. Use of this information by anyone other than 00008 // authorized employees of Tech Soft 3D, LLC. is granted only under a 00009 // written non-disclosure agreement, expressly prescribing the scope and 00010 // manner of such use. 00011 // 00012 // $Id$ 00013 // 00018 #ifndef _HERRORMANAGER_H 00019 #define _HERRORMANAGER_H 00020 00021 #ifdef H_PACK_8 00022 #pragma pack(push) 00023 #pragma pack(8) 00024 #endif 00025 00026 #include "HTools.h" 00027 00028 /* forward declaration. 00029 * private helper class */ 00030 class HErrorDescriptorNode; 00031 00033 struct HSuppressInfo 00034 { 00035 HSuppressInfo(int s, int c, int sp) 00036 { 00037 severity = s; 00038 category = c; 00039 specific = sp; 00040 } 00041 int severity; 00042 int category; 00043 int specific; 00044 }; 00045 00046 00048 00050 class MVO_API HErrorNode 00051 { 00052 00053 public: 00065 HErrorNode(int category, int specific, int severity, int msgc, char **msgv, int stackc, char ** stackv, double time); 00066 ~HErrorNode(); 00067 00070 void Report(); 00071 00072 int m_category; 00073 int m_specific; 00074 int m_severity; 00075 int m_messagelength; 00076 double m_time; 00077 char **m_message; 00078 int m_stacklength; 00079 char **m_stack; 00080 00081 00082 }; 00083 00084 00085 00086 00088 00090 class MVO_API HErrorManager 00091 { 00092 private: 00093 static struct vlist_s * m_ErrorList; 00094 static struct vlist_s * m_UpdateErrorList; 00095 static struct vlist_s * m_SuppressList; 00096 static void (* m_pfError)(HErrorNode *, void *); 00097 static void * m_UserData; 00098 static bool * m_ErrorClass; 00099 static bool m_bShowDialog; 00100 static bool m_bDialogRunning; 00101 static bool m_bBlocked; 00102 static bool m_bInterrupted; 00103 static bool m_bSpoolUpdateErrors; 00104 00105 public: 00109 static void Init(); 00112 static void Cleanup(); 00116 static void BeginErrorIteration(); 00119 static HErrorNode * GetNextError(); 00122 static HErrorNode * GetLastError(); 00125 static void DeleteLastError(); 00128 static void ShowAllErrors(); 00134 static void SpoolUpdateErrors(); 00135 00137 static void SetErrorCallback(void (* err)(HErrorNode *, void *), void *user_data) { m_pfError = err; m_UserData = user_data; } 00138 00148 static void SuppressError(int severity, int category, int specific); 00149 00151 static void Flush(); 00152 00156 static void SetShowDialog(bool s) { m_bShowDialog = s; } 00159 static void SetSpoolUpdateErrors(bool s) { m_bSpoolUpdateErrors = s; } 00162 static bool GetShowDialog() { return m_bShowDialog; } 00166 static void AllowAllErrors(); 00167 00169 static bool GetDialogRunning() { return m_bDialogRunning; } 00170 00187 static void CallbackEntryPoint( 00188 int category, int specific, int severity, 00189 int msgc, char **msgv, int stackc, char **stackv 00190 ); 00191 00192 }; 00193 00194 00195 00196 #ifdef H_PACK_8 00197 #pragma pack(pop) 00198 #endif 00199 00200 #endif 00201 00202 00203