00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #pragma once
00013
00015 #include "nvsgcommon.h"
00016
00017 #include <string>
00018
00019 namespace nvsg
00020 {
00021
00022 class NVSGException;
00024 typedef void NVSGERRORHANDLER(const NVSGException&);
00025
00029 extern NVSGERRORHANDLER * nvsgErrorHandler;
00039 NVSGERRORHANDLER * nvsgSetErrorHandler(NVSGERRORHANDLER * newErrorHandler);
00040
00044 class NVSGException
00045 {
00046 public:
00055 NVSGException(bool critical, const std::string& errMsg) : m_critical(critical), m_errMsg(errMsg) {}
00069 NVSGException(bool critical, unsigned int errMsgID) {}
00070 virtual ~NVSGException() {}
00071
00082 virtual bool isCritical() const;
00088 virtual const std::string& getErrorMessage() const;
00089
00090 private:
00091 bool m_critical;
00092 std::string m_errMsg;
00093 };
00094
00095
00096
00097 inline bool NVSGException::isCritical() const
00098 {
00099 return m_critical;
00100 }
00101
00102 inline const std::string& NVSGException::getErrorMessage() const
00103 {
00104 return m_errMsg;
00105 }
00106
00107 }