Alphabetical Class Index  Class Hierarchy   File Members   Compound Members   File List  

HErrorManager.h
Go to the documentation of this file.
1 // Copyright (c) 1998-2014 by Tech Soft 3D, Inc.
2 //
3 // The information contained herein is confidential and proprietary to Tech Soft 3D, Inc.,
4 // and considered a trade secret as defined under civil and criminal statutes.
5 // Tech Soft 3D, Inc. shall pursue its civil and criminal remedies in the event of
6 // unauthorized use or misappropriation of its trade secrets. Use of this information
7 // by anyone other than authorized employees of Tech Soft 3D, Inc. is granted only under
8 // a written non-disclosure agreement, expressly prescribing the scope and manner of such use.
9 
14 #ifndef _HERRORMANAGER_H
15 #define _HERRORMANAGER_H
16 
17 #ifdef H_PACK_8
18 #pragma pack(push)
19 #pragma pack(8)
20 #endif
21 
22 #include "HTools.h"
23 
24 /* forward declaration.
25  * private helper class */
26 class HErrorDescriptorNode;
27 
30 {
31  HSuppressInfo(int s, int c, int sp)
32  {
33  severity = s;
34  category = c;
35  specific = sp;
36  }
37  int severity;
38  int category;
39  int specific;
40 };
41 
42 
44 
46 class MVO_API HErrorNode
47 {
48 
49 public:
61  HErrorNode(int category, int specific, int severity, int msgc, char const ** msgv, int stackc, char const ** stackv, double time);
62  ~HErrorNode();
63 
66  void Report();
67 
72  double m_time;
73  char const ** m_message;
75  char const ** m_stack;
76 
77 
78 };
79 
80 
81 
82 
84 
86 class MVO_API HErrorManager
87 {
88 private:
89  static struct vlist_s * m_ErrorList;
90  static struct vlist_s * m_UpdateErrorList;
91  static struct vlist_s * m_SuppressList;
92  static void (* m_pfError)(HErrorNode *, void *);
93  static void * m_UserData;
94  static bool * m_ErrorClass;
95  static bool m_bShowDialog;
96  static bool m_bDialogRunning;
97  static bool m_bBlocked;
98  static bool m_bInterrupted;
99  static bool m_bSpoolUpdateErrors;
100 
101 public:
105  static void Init();
108  static void Cleanup();
112  static void BeginErrorIteration();
115  static HErrorNode * GetNextError();
118  static HErrorNode * GetLastError();
121  static void DeleteLastError();
124  static void ShowAllErrors();
130  static void SpoolUpdateErrors();
131 
133  static void SetErrorCallback(void (* err)(HErrorNode *, void *), void *user_data) { m_pfError = err; m_UserData = user_data; }
134 
144  static void SuppressError(int severity, int category, int specific);
145 
147  static void Flush();
148 
152  static void SetShowDialog(bool s) { m_bShowDialog = s; }
155  static void SetSpoolUpdateErrors(bool s) { m_bSpoolUpdateErrors = s; }
158  static bool GetShowDialog() { return m_bShowDialog; }
162  static void AllowAllErrors();
163 
165  static bool GetDialogRunning() { return m_bDialogRunning; }
166 
183  static void CallbackEntryPoint(
184  int category, int specific, int severity,
185  int msgc, char const ** msgv, int stackc, char const ** stackv
186  );
187 
188 };
189 
190 
191 
192 #ifdef H_PACK_8
193 #pragma pack(pop)
194 #endif
195 
196 #endif
197 
198 
199 
The HErrorManager class handles all the error messaging in MVO.
Definition: HErrorManager.h:86
double m_time
The time that the error was generated in seconds.
Definition: HErrorManager.h:72
int severity
The level of seriousness of this error.
Definition: HErrorManager.h:37
int m_category
The category that this error falls under as described in HC_Define_Error_Handler. ...
Definition: HErrorManager.h:68
int m_severity
The level of seriousness of this error.
Definition: HErrorManager.h:70
static void SetShowDialog(bool s)
Definition: HErrorManager.h:152
int m_specific
The specific error under the category as described in HC_Define_Error_Handler.
Definition: HErrorManager.h:69
int category
The category that this error falls under as described in HC_Define_Error_Handler. ...
Definition: HErrorManager.h:38
The HErrorNode class encapsulates error message information.
Definition: HErrorManager.h:46
int m_messagelength
The number of messages associated with this error.
Definition: HErrorManager.h:71
static bool GetShowDialog()
Definition: HErrorManager.h:158
char const ** m_stack
The list of functions that generated the error.
Definition: HErrorManager.h:75
static bool GetDialogRunning()
Definition: HErrorManager.h:165
char const ** m_message
The list messages associated with the error.
Definition: HErrorManager.h:73
static void SetErrorCallback(void(*err)(HErrorNode *, void *), void *user_data)
Definition: HErrorManager.h:133
int specific
The specific error under the category as described in HC_Define_Error_Handler.
Definition: HErrorManager.h:39
static void SetSpoolUpdateErrors(bool s)
Definition: HErrorManager.h:155
The HSuppressInfo contains information used to identify which errors should be suppressed.
Definition: HErrorManager.h:29
int m_stacklength
The length of the call stack.
Definition: HErrorManager.h:74