Alphabetical Class Index  Class Hierarchy   File Members   Compound Members   File List  

HErrorManager.h
Go to the documentation of this file.
00001 // Copyright (c) 1998-2014 by Tech Soft 3D, Inc.
00002 //
00003 // The information contained herein is confidential and proprietary to Tech Soft 3D, Inc.,
00004 // and considered a trade secret as defined under civil and criminal statutes.
00005 // Tech Soft 3D, Inc. shall pursue its civil and criminal remedies in the event of
00006 // unauthorized use or misappropriation of its trade secrets.  Use of this information
00007 // by anyone other than authorized employees of Tech Soft 3D, Inc. is granted only under
00008 // a written non-disclosure agreement, expressly prescribing the scope and manner of such use.
00009 
00014 #ifndef _HERRORMANAGER_H
00015 #define _HERRORMANAGER_H
00016 
00017 #ifdef H_PACK_8
00018 #pragma pack(push)
00019 #pragma pack(8)
00020 #endif
00021 
00022 #include "HTools.h"
00023 
00024 /* forward declaration.  
00025  * private helper class */
00026 class HErrorDescriptorNode;
00027 
00029 struct HSuppressInfo
00030 {
00031     HSuppressInfo(int s, int c, int sp)
00032     {
00033         severity = s;
00034         category = c;
00035         specific = sp;
00036     }
00037     int severity;
00038     int category;
00039     int specific;
00040 };
00041 
00042 
00044 
00046 class MVO_API HErrorNode
00047 {
00048 
00049 public:
00061     HErrorNode(int category, int specific, int severity, int msgc, char const ** msgv, int stackc, char const ** stackv, double time);
00062     ~HErrorNode();
00063 
00066     void Report();
00067 
00068     int m_category;
00069     int m_specific;
00070     int m_severity;
00071     int m_messagelength;
00072     double m_time;
00073     char const ** m_message;
00074     int m_stacklength;
00075     char const ** m_stack;
00076     
00077 
00078 };
00079 
00080    
00081 
00082 
00084 
00086 class MVO_API HErrorManager 
00087 {
00088 private:   
00089     static  struct vlist_s *    m_ErrorList;            
00090     static  struct vlist_s *    m_UpdateErrorList;          
00091     static  struct vlist_s *    m_SuppressList;         
00092     static  void            (* m_pfError)(HErrorNode *, void *); 
00093     static  void *          m_UserData;
00094     static  bool *          m_ErrorClass;
00095     static  bool            m_bShowDialog;
00096     static  bool            m_bDialogRunning;
00097     static  bool            m_bBlocked;
00098     static  bool            m_bInterrupted;
00099     static  bool            m_bSpoolUpdateErrors;
00100 
00101 public:
00105     static void Init();
00108     static void Cleanup();
00112     static void BeginErrorIteration();
00115     static HErrorNode * GetNextError();
00118     static HErrorNode * GetLastError();
00121     static void DeleteLastError();
00124     static void ShowAllErrors();
00130     static void SpoolUpdateErrors();
00131 
00133     static void SetErrorCallback(void (* err)(HErrorNode *, void *), void *user_data) { m_pfError = err; m_UserData = user_data; }
00134 
00144     static void SuppressError(int severity, int category, int specific);
00145 
00147     static void Flush();
00148 
00152     static void SetShowDialog(bool s) { m_bShowDialog = s; }
00155     static void SetSpoolUpdateErrors(bool s) { m_bSpoolUpdateErrors = s; }
00158     static bool GetShowDialog() { return m_bShowDialog; }
00162     static void AllowAllErrors();
00163 
00165     static bool GetDialogRunning() { return m_bDialogRunning; }
00166     
00183     static void CallbackEntryPoint( 
00184         int category, int specific, int severity,
00185         int msgc, char const * msgv[], int stackc, char const * stackv[]);
00186 
00187 };
00188 
00189 
00190 
00191 #ifdef H_PACK_8
00192 #pragma pack(pop)
00193 #endif
00194 
00195 #endif
00196 
00197 
00198