Mudbox/error.h Source File

error.h
Go to the documentation of this file.
1 
2 //**************************************************************************/
3 // Copyright (c) 2008 Autodesk, Inc.
4 // All rights reserved.
5 //
6 // Use of this software is subject to the terms of the Autodesk license
7 // agreement provided at the time of installation or download, or which
8 // otherwise accompanies this software in either electronic or hard copy form.
9 //
10 //**************************************************************************/
11 // DESCRIPTION:
12 // CREATED: October 2008
13 //**************************************************************************/
14 
15 #include <QtCore/QCoreApplication>
16 
17 namespace mudbox {
47 {
49 
50 protected:
52  bool m_bOnHeap;
53  const char *m_pFunction, *m_pSource;
54  unsigned int m_iLine;
55 
56 public:
57  enum Code
58  {
67  codeUnknown = 0xffffffff
68  } m_eCode;
69 
70 private:
71  Error( const QString &sMessage, bool bOnHeap, Code eCode = codeUnspecified );
72 
73 public:
80  Error(
81  const QString &sMessage,
82  Code eCode = codeUnspecified,
83  const char *pFunction = 0,
84  const char *pSourceFileName = 0,
85  unsigned int iLine = 0
86  );
87 
90  Error *Format( const QString &sMessage );
91 
93  enum Code Code( void ) const;
94 
96  const QString &Message( void ) const;
97 
104  void Report(
105  const QString &sPre = ""
106  ) const;
107 
109  void Discard( void ) const;
110 
112  static void ThrowBadAlloc( void ) { throw &s_cBadAlloc; };
113 
114  static Error s_cBadAlloc;
115 };
116 
117 }; // end of namespace mudbox
118 
unsigned int m_iLine
Definition: error.h:54
Holds information about an error.
Definition: error.h:46
bool m_bOnHeap
Definition: error.h:52
QString m_sErrorMessage
Definition: error.h:51
Class: ConvolutionKernel.
Definition: array.h:15
static void ThrowBadAlloc(void)
Throws a static bad alloc exception. (No memory allocation is required to report allocation problems...
Definition: error.h:112
const char * m_pSource
Definition: error.h:53
#define Q_DECLARE_TR_FUNCTIONS(context)
#define MBDLL_DECL
Definition: dllinterface.h:35